Files
real-shooter/Assets/Scripts/Managers/TimeManager.cs
2022-04-18 09:34:08 +07:00

29 lines
648 B
C#
Executable File

using System.Collections;
using System.Collections.Generic;
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 one Instance");
Destroy(gameObject);
}
}
void Update()
{
CurrentTime += Time.deltaTime;
}
}