27 lines
562 B
C#
Executable File
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;
|
|
}
|
|
}
|