KitchenChaos/Assets/Scripts/Counters/BaseCounter.cs

39 lines
879 B
C#

using System;
using UnityEngine;
public class BaseCounter : MonoBehaviour, IKitchenObjectParent
{
public static event EventHandler OnAnyObjectPlacedHere;
public Transform CounterTopPoint { get; set; }
public Transform KitchenObjectHoldPoint { get; set; }
private KitchenObject kitchenObject;
public KitchenObject KitchenObject
{
get => kitchenObject;
set
{
kitchenObject = value;
if (value != null)
{
OnAnyObjectPlacedHere?.Invoke(this, EventArgs.Empty);
}
}
}
public void Awake()
{
CounterTopPoint = transform.Find("CounterTopPoint");
KitchenObjectHoldPoint = CounterTopPoint;
}
public virtual void Interact(Player player)
{
Debug.LogError("Something went wrong, Interaction with BaseCounter");
}
public virtual void InteractAlternate(Player player)
{
Debug.LogError("Something went wrong, Interaction with BaseCounter");
}
}