Files

39 lines
912 B
C#
Raw Permalink Normal View History

using Game;
using UnityEngine;
2025-04-18 15:54:50 -04:00
/// <summary>
/// This class controls the visibility of the obstacle end object based on the current game mode.
/// </summary>
public class ObstacleEnd : MonoBehaviour
{
2025-04-18 15:54:50 -04:00
/// <summary>
/// Initializes the visibility of the object when the game starts.
/// </summary>
private void Start()
{
UpdateVisibility();
}
2025-04-18 15:54:50 -04:00
/// <summary>
/// Updates the visibility of the object every frame.
/// </summary>
private void Update()
{
UpdateVisibility();
}
2025-04-18 15:54:50 -04:00
/// <summary>
/// Sets the object to be active only if the game mode is "Obstacle Course".
/// </summary>
private void UpdateVisibility()
{
if (GameManager.gameMode == GameManager.GameMode.obstacleCourse)
{
gameObject.SetActive(true);
}
else
{
gameObject.SetActive(false);
}
}
}