Move container logic to use inheritence and move logic around.
Also fix the clear counter spawning items, next I'm going to implament the logic for placing food onto them instead.
This commit is contained in:
parent
234e00cb9b
commit
44837c6c13
21 changed files with 1478 additions and 397 deletions
|
@ -5,8 +5,8 @@ using UnityEngine;
|
|||
public class SelectedCounterVisual : MonoBehaviour
|
||||
{
|
||||
|
||||
[SerializeField] private ClearCounter clearCounter;
|
||||
[SerializeField] private GameObject visualGameObject;
|
||||
[SerializeField] private BaseCounter baseCounter;
|
||||
[SerializeField] private GameObject[] visualGameObjectArray;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ public class SelectedCounterVisual : MonoBehaviour
|
|||
|
||||
private void Player_OnSelectedcounterChanged(object sender, Player.OnSelectedCounterChangedEventArgs e)
|
||||
{
|
||||
if (e.selectedCounter == clearCounter)
|
||||
if (e.selectedCounter == baseCounter)
|
||||
{
|
||||
Show();
|
||||
} else
|
||||
|
@ -25,12 +25,18 @@ public class SelectedCounterVisual : MonoBehaviour
|
|||
}
|
||||
|
||||
private void Show()
|
||||
{
|
||||
visualGameObject.SetActive(true);
|
||||
{
|
||||
foreach (GameObject visualGameObject in visualGameObjectArray)
|
||||
{
|
||||
visualGameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void Hide()
|
||||
{
|
||||
visualGameObject.SetActive(false);
|
||||
foreach (GameObject visualGameObject in visualGameObjectArray)
|
||||
{
|
||||
visualGameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue