using Game;
using UnityEngine;
///
/// This class controls the visibility of the obstacle end object based on the current game mode.
///
public class ObstacleEnd : 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 active only if the game mode is "Obstacle Course".
///
private void UpdateVisibility()
{
if (GameManager.gameMode == GameManager.GameMode.obstacleCourse)
{
gameObject.SetActive(true);
}
else
{
gameObject.SetActive(false);
}
}
}