Files
real-shooter/Assets/Scripts/Managers/TimeManager.cs
2022-04-12 11:54:05 +07:00

27 lines
562 B
C#
Executable File

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;
}
}