Plate holding object logic

This commit is contained in:
BuyMyMojo 2023-03-02 05:48:13 +11:00
parent 7a3073ea8a
commit 3256232b12
8 changed files with 121 additions and 7 deletions

View file

@ -46,6 +46,19 @@ public class KitchenObject : MonoBehaviour
Destroy(gameObject);
}
public bool TryGetPlate(out PlateKitchenObject plateKitchenObject)
{
if (this is PlateKitchenObject)
{
plateKitchenObject = this as PlateKitchenObject;
return true;
} else
{
plateKitchenObject = null;
return false;
}
}
static public KitchenObject SpawnKitchenObject(KitchenObjectSO kitchenObjectSO, IKitchenObjectParent kitchenObjectParent)
{
Transform kitchenObjectTransform = Instantiate(kitchenObjectSO.prefab);