Decomposition des Workshop

This commit is contained in:
Antoine H 2020-12-10 13:51:16 +01:00
parent 4aa2aef787
commit f71d1e8b62
4 changed files with 73 additions and 65 deletions

View file

@ -3,16 +3,15 @@ using System.Collections.Generic;
using UnityEngine;
//Define the behavior of a cleaning workshop
public class Cleaning_workshop : MonoBehaviour
public class Cleaning_workshop : Workshop
{
public float cleanTime=2.0f; //Time to clean a mug
// List<GameObject> stock = new List<GameObject>(); //List of mug in workshop
//Handle objects interactions w/ Workshop
//Return wether the object is taken from tavernkeeper
public bool use(GameObject object_used)
public override bool use(GameObject object_used)
{
if(object_used != null && object_used.tag=="Mug")
if(object_used != null && object_used.tag=="Grabable")
{
Mug mug = object_used.GetComponent<Mug>();
if (mug!= null && mug.content is null && mug.dirty) //Mug dirty & empty
@ -24,14 +23,4 @@ public class Cleaning_workshop : MonoBehaviour
}
return false;
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}