Visualise burger construction on plate

This commit is contained in:
BuyMyMojo 2023-03-02 06:17:41 +11:00
parent 3256232b12
commit 42cd3341fb
8 changed files with 388 additions and 11 deletions

View file

@ -0,0 +1,39 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlateCompleteVisual : MonoBehaviour
{
[Serializable]
public struct KitchenObjectSO_GameObject
{
public KitchenObjectSO kitchenObjectSO;
public GameObject gameObject;
}
[SerializeField] private PlateKitchenObject plateKitchenObject;
[SerializeField] private List<KitchenObjectSO_GameObject> kitchenObjectSOGameObjectList;
private void Start()
{
plateKitchenObject.OnIngreedientAdded += PlateKitchenObject_OnIngreedientAdded;
foreach (KitchenObjectSO_GameObject kitchenObjectSOGameObject in kitchenObjectSOGameObjectList)
{
kitchenObjectSOGameObject.gameObject.SetActive(false);
}
}
private void PlateKitchenObject_OnIngreedientAdded(object sender, PlateKitchenObject.OnIngreedientAddedEventArgs e)
{
foreach (KitchenObjectSO_GameObject kitchenObjectSOGameObject in kitchenObjectSOGameObjectList)
{
if (kitchenObjectSOGameObject.kitchenObjectSO == e.KitchenObjectSO)
{
kitchenObjectSOGameObject.gameObject.SetActive(true);
}
}
}
}