27 lines
620 B
C#
27 lines
620 B
C#
using UnityEngine;
|
|
|
|
public class CubeClash_VictoryManager : MonoBehaviour
|
|
{
|
|
public GameObject winScreen;
|
|
public static CubeClash_VictoryManager Instance;
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
void Update()
|
|
{
|
|
CubeClash_ZibuController[] zibus = FindObjectsOfType<CubeClash_ZibuController>();
|
|
if (zibus.Length == 1)
|
|
{
|
|
DeclareWinner(zibus[0].gameObject);
|
|
}
|
|
}
|
|
|
|
void DeclareWinner(GameObject winner)
|
|
{
|
|
if (winScreen) winScreen.SetActive(true);
|
|
Debug.Log("Winner: " + winner.name);
|
|
enabled = false;
|
|
}
|
|
}
|