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

28 lines
541 B
C#
Raw Normal View History

2025-04-16 19:57:54 -04:00
using UnityEngine; using Game; using Music; using Player;
namespace Game
{
2025-03-20 14:45:29 -04:00
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);
}
}
}
2025-04-16 19:57:54 -04:00
}