Visualise burger construction on plate
This commit is contained in:
parent
3256232b12
commit
42cd3341fb
8 changed files with 388 additions and 11 deletions
39
Assets/Scripts/PlateCompleteVisual.cs
Normal file
39
Assets/Scripts/PlateCompleteVisual.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in a new issue