protected void HandleTimerStatusChangedMessage(Message message) { if (UseTimerOut) { TimerStatusChangedMessage mess = message as TimerStatusChangedMessage; switch (mess.g_timerStatus) { case TimerStatus.Completed: if (TimeOutIsLoss) { AddFail(LevelFinishedReason.TimerOut, null); } else { AddWin(LevelFinishedReason.TimerOut, null); } break; default: break; } } }
protected override void GameUpdate() { float deltaTime = g_currentTime - g_previousTime; currentTime += deltaTime; if (currentTime >= dayLength) { currentTime -= dayLength; } if (limitTime) { if (timeLeft > 0) { timeLeft -= deltaTime; } else { TimerStatusChangedMessage message = new TimerStatusChangedMessage(TimerStatus.Completed); MessageCenter.Instance.Broadcast(message); timeLeft = 0; } } }
protected override void GameUpdate() { float deltaTime = g_currentTime - g_previousTime; currentTime += deltaTime; if( currentTime >= dayLength ) currentTime -= dayLength; if( limitTime ) { if( timeLeft > 0 ) { timeLeft -= deltaTime; } else { TimerStatusChangedMessage message = new TimerStatusChangedMessage( TimerStatus.Completed ); MessageCenter.Instance.Broadcast( message ); timeLeft = 0; } } }