KitchenChaos/Assets/Scripts/Counters/BaseCounter.cs

30 lines
993 B
C#

using System;
using Unity.Netcode;
using UnityEngine;
public class BaseCounter : NetworkBehaviour, IKitchenObjectParent {
public KitchenObject kitchenObject;
private Transform CounterTopPoint { get; set; }
public Transform GetKitchenObjectFollowTransform() => CounterTopPoint;
public void Awake() {
CounterTopPoint = transform.Find("CounterTopPoint");
}
public KitchenObject KitchenObject {
get => kitchenObject;
set {
kitchenObject = value;
if (value is not null) OnAnyObjectPlacedHere?.Invoke(this, EventArgs.Empty);
}
}
public NetworkObject GetNetworkObject() => NetworkObject;
public static event EventHandler OnAnyObjectPlacedHere;
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");
}