Initial. Added files
This commit is contained in:
26
Assets/Scripts/Managers/TimeManager.cs
Executable file
26
Assets/Scripts/Managers/TimeManager.cs
Executable file
@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class TimeManager : MonoBehaviour
|
||||
{
|
||||
public static TimeManager instance = null;
|
||||
public float CurrentTime;
|
||||
void Start()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = this;
|
||||
instance.CurrentTime = 0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Only one Instance");
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
void Update()
|
||||
{
|
||||
CurrentTime += Time.deltaTime;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user