using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlateKitchenObject : KitchenObject { [SerializeField] private List validKitchenObjectSOList; private List kitchenObjectSOList; private void Awake() { kitchenObjectSOList = new List(); } 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; } } }