ProjetPatate/Assets/Scripts/Workshop.cs

25 lines
919 B
C#
Raw Normal View History

2020-12-05 13:38:13 +01:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2020-12-10 13:51:16 +01:00
//Define the behavior of a workshop
2020-12-05 13:38:13 +01:00
[RequireComponent(typeof(Collider2D))]
2020-12-10 13:51:16 +01:00
public abstract class Workshop : MonoBehaviour, IUsable
2020-12-05 13:38:13 +01:00
{
2020-12-05 15:22:00 +01:00
public float prepTime = 2.0f; //Time for preparation of product
2020-12-10 13:51:16 +01:00
protected GameObject currentMug = null; //Mug currently stocked in workshop
2020-12-05 13:38:13 +01:00
2020-12-05 15:22:00 +01:00
//Handle objects interactions w/ Workshop
2020-12-05 13:38:13 +01:00
//Return wether the object is taken from tavernkeeper
2020-12-10 13:51:16 +01:00
public abstract bool use(GameObject userObject);
2020-12-05 13:38:13 +01:00
// Start is called before the first frame update
void Start()
{
2020-12-07 17:22:30 +01:00
if(gameObject.layer != LayerMask.NameToLayer("Interactions"))
Debug.LogWarning(gameObject.name+" layer should be set to 'Interactions' to work properly");
2020-12-10 11:57:23 +01:00
if(gameObject.tag != "Usable")
Debug.LogWarning(gameObject.name+" tag should be set to 'Usable' to work properly");
2020-12-05 13:38:13 +01:00
}
}