Add selected clear sounter highlight
This commit is contained in:
parent
5772da3965
commit
989648c00b
18 changed files with 352 additions and 127 deletions
34
Assets/Scripts/SelectedCounterVisual.cs
Normal file
34
Assets/Scripts/SelectedCounterVisual.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class SelectedCounterVisual : MonoBehaviour
|
||||
{
|
||||
|
||||
[SerializeField] private ClearCounter clearCounter;
|
||||
[SerializeField] private GameObject visualGameObject;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Player.Instance.OnSelectedcounterChanged += Player_OnSelectedcounterChanged;
|
||||
}
|
||||
|
||||
private void Player_OnSelectedcounterChanged(object sender, Player.OnSelectedCounterChangedEventArgs e)
|
||||
{
|
||||
if (e.selectedCounter == clearCounter)
|
||||
{
|
||||
Show();
|
||||
} else
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
|
||||
private void Show()
|
||||
{
|
||||
visualGameObject.SetActive(true);
|
||||
}
|
||||
|
||||
private void Hide()
|
||||
{
|
||||
visualGameObject.SetActive(false);
|
||||
}
|
||||
}
|
Reference in a new issue