HAARFTE/Assets/DemoGame/GameScript/Loader/GlobalData.cs

27 lines
565 B
C#
Raw Normal View History

using System;
2024-10-26 23:50:18 +08:00
using UnityEngine;
namespace Unity.Loader
{
public class GlobalData
{
private DateTime _startTime;
private TimeSpan _runTime => System.DateTime.Now - _startTime;
2024-10-26 23:50:18 +08:00
public string runTimeStr => $"{_runTime:hh\\:mm\\:ss}";
private int _score;
public int score => _score;
2024-10-26 23:50:18 +08:00
public GlobalData()
{
_startTime = DateTime.Now;
_score = 0;
}
2024-10-26 23:50:18 +08:00
public void Dispose()
{
Debug.Log($"程序运行时长:{runTimeStr}");
}
}
}