using UnityEngine;
using Game;
using Music;
using Player;
namespace Game
{
///
/// This class controls the visibility of an object based on the current game mode.
///
public class ObjectVisibility : MonoBehaviour
{
///
/// Initializes the visibility of the object when the game starts.
///
private void Start()
{
UpdateVisibility();
}
///
/// Updates the visibility of the object every frame.
///
private void Update()
{
UpdateVisibility();
}
///
/// Sets the object to be visible only if the game mode is "Keep Away".
///
private void UpdateVisibility()
{
if (GameManager.gameMode == GameManager.GameMode.keepAway)
{
gameObject.SetActive(true);
}
else
{
gameObject.SetActive(false);
}
}
}
}