How to get the difference between two GAME TIME?
private DateTime Begin;
public const int TimeScale = 60;
public const int UpdateRealSec = 1;
private void Awake()
{
Begin = new DateTime(1, 1, 1, 7, 00, 0);
}
public DateTime GetGameTime()
{
long gameTickDiff = (DateTime.Now - Begin).Ticks / TimeScale;
return new DateTime(Begin.Ticks + gameTickDiff);
}
call action by update()
Update()
{
var time = GetGameTime();
bool overAnHour; // check time over one hour , call action
if(overAnHour)
{
foreach(var dic in TimeRegDic)
{
dic.Key.Invoke();
}
}
}