2025-04-18 15:54:50 -04:00
|
|
|
using UnityEngine;
|
|
|
|
|
using Game;
|
|
|
|
|
using Music;
|
|
|
|
|
using Player;
|
2025-03-31 18:28:05 -04:00
|
|
|
|
2025-04-18 15:54:50 -04:00
|
|
|
namespace Game
|
2025-03-31 18:28:05 -04:00
|
|
|
{
|
2025-04-18 15:54:50 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// This class helps manage positions for the GameManager during development.
|
|
|
|
|
/// It allows adding hat spawn positions and player spawn positions directly in the editor.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ExecuteAlways]
|
|
|
|
|
public class GameManagerHelper : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// If true, adds the current position of the "HELPER" object to the hat spawn positions in the GameManager.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool addHatPosition;
|
2025-03-31 18:28:05 -04:00
|
|
|
|
2025-04-18 15:54:50 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// If true, sets the current position of the "HELPER" object as the player spawn position in the GameManager.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool addSpawnPosition;
|
2025-03-31 18:28:05 -04:00
|
|
|
|
2025-04-18 15:54:50 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// Checks for changes to the addHatPosition and addSpawnPosition flags every frame.
|
|
|
|
|
/// Updates the GameManager with the corresponding positions when the flags are set.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void Update()
|
2025-03-31 18:28:05 -04:00
|
|
|
{
|
2025-04-18 15:54:50 -04:00
|
|
|
// Add the current position of the "HELPER" object to the hat spawn positions
|
|
|
|
|
if (addHatPosition)
|
|
|
|
|
{
|
|
|
|
|
addHatPosition = false; // Reset the flag
|
|
|
|
|
GetComponent<GameManager>().hatSpawnPositions.Add(GameObject.Find("HELPER").transform.position);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the current position of the "HELPER" object as the player spawn position
|
|
|
|
|
if (addSpawnPosition)
|
|
|
|
|
{
|
|
|
|
|
addSpawnPosition = false; // Reset the flag
|
|
|
|
|
GetComponent<GameManager>().spawnPosition = GameObject.Find("HELPER").transform.position;
|
|
|
|
|
}
|
2025-03-31 18:28:05 -04:00
|
|
|
}
|
|
|
|
|
}
|
2025-04-16 19:57:54 -04:00
|
|
|
}
|