Initial. Added files

This commit is contained in:
Andrey Gumirov
2022-04-12 11:54:05 +07:00
parent 19900f6446
commit 8aa8e3d79b
254 changed files with 44750 additions and 0 deletions

View File

@ -0,0 +1,57 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditorInternal;
using UnityEngine;
public class GameManager : MonoBehaviour
{
private static GameManager instance;
public static GameManager Instance { get { return instance; } }
private void Awake()
{
if (Instance == null)
instance = this;
else if (Instance == this)
Destroy(gameObject);
}
private void Start()
{
GlobalEventManager.onCaptureFlag += flagCaptured;
GlobalEventManager.onTimeLeft += timeOut;
}
private void Update()
{
}
private void flagCaptured(Team team)
{
switch(team)
{
case Team.Attackers:
Debug.Log("Attackers Win");
break;
case Team.Defenders:
Debug.Log("Defenders Win");
break;
default:
Debug.LogError("Unexpected Team");
break;
}
}
private void timeOut()
{
Debug.Log("Time is out");
}
private void OnDestroy()
{
GlobalEventManager.onCaptureFlag -= flagCaptured;
GlobalEventManager.onTimeLeft -= timeOut;
}
}