29 lines
703 B
C#
Executable File
29 lines
703 B
C#
Executable File
using UnityEngine;
|
|
|
|
public class TimeManager : MonoBehaviour
|
|
{
|
|
private static TimeManager instance;
|
|
public static TimeManager Instance { get { return instance; } }
|
|
|
|
public float CurrentTime { get; private set; }
|
|
void Start()
|
|
{
|
|
if (instance == null)
|
|
{
|
|
instance = this;
|
|
instance.CurrentTime = 0f;
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("Only 1 Instance");
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
void Update()
|
|
{
|
|
CurrentTime += Time.deltaTime;
|
|
if (CurrentTime > SettingsReader.Instance.GetSettings.TimeOut)
|
|
GlobalEventManager.SendTimeout();
|
|
}
|
|
}
|