ProjetAMJV_CR/Assets/Scripts/Singletons/GameManager.cs
2025-01-28 02:56:56 +01:00

31 lines
696 B
C#

using System.Collections;
using UnityEngine;
public class GameManager : MonoBehaviourSingletonPersistent<GameManager>
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
// Delete, use only for Debug
if (Input.GetKeyDown(KeyCode.Space))
{
StartFightForAll();
}
}
public void StartFightForAll()
{
AbstractUnit[] units = FindObjectsByType<AbstractUnit>(FindObjectsSortMode.None);
foreach (var unit in units)
{
unit.StartFight();
}
}
}