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

@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlateKitchenObject : KitchenObject
{
[SerializeField] private List<KitchenObjectSO> validKitchenObjectSOList;
private List<KitchenObjectSO> kitchenObjectSOList;
private void Awake()
{
kitchenObjectSOList = new List<KitchenObjectSO>();
}
public bool TryAddIngreedient(KitchenObjectSO kitchenObjectSO)
{
if (!validKitchenObjectSOList.Contains(kitchenObjectSO))
{
// Not a valid ingreedient
return false;
}
if (kitchenObjectSOList.Contains(kitchenObjectSO))
{
return false;
} else
{
kitchenObjectSOList.Add(kitchenObjectSO);
return true;
}
}
}