Files
Crash-Course/Assets/Scripts/Game/ObjectVisibility.cs

27 lines
485 B
C#
Raw Normal View History

2025-03-20 14:45:29 -04:00
using UnityEngine;
public class ObjectVisibility : MonoBehaviour
{
void Start()
{
UpdateVisibility();
}
void Update()
{
UpdateVisibility();
}
private void UpdateVisibility() // Sets object visible if playing keep away mode
2025-03-20 14:45:29 -04:00
{
if (GameManager.gameMode == GameManager.GameMode.keepAway)
{
gameObject.SetActive(true);
}
else
{
gameObject.SetActive(false);
}
}
}