2025-04-17 17:19:02 -04:00
|
|
|
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>
|
2025-04-17 17:19:02 -04:00
|
|
|
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()
|
2025-04-17 17:19:02 -04:00
|
|
|
{
|
|
|
|
|
UpdateVisibility();
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-18 15:54:50 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// Updates the visibility of the object every frame.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void Update()
|
2025-04-17 17:19:02 -04:00
|
|
|
{
|
|
|
|
|
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()
|
2025-04-17 17:19:02 -04:00
|
|
|
{
|
|
|
|
|
if (GameManager.gameMode == GameManager.GameMode.obstacleCourse)
|
|
|
|
|
{
|
|
|
|
|
gameObject.SetActive(true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gameObject.SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|