Beispiel #1
0
 private void CloseTimer_Tick(object sender, EventArgs e)
 {
     if (DoClose)
     {
         LevelTimer.Stop();
         TalkTimer.Stop();
         Text = "Operation Complete!";
         MainProgressBar.Value = MainProgressBar.Maximum;
         Close();
     }
 }
    /// <summary>
    /// Prepare summary UI of the level, save score and send event that trail was completed.
    /// </summary>
    private void TrailCompleted()
    {
        // Activate the summary
        UISummary.SetActive(true);
        long      timeMSElapsed = levelTimer.Stop();
        int       scorePoints   = (int)timeMSElapsed * player.Health / player.MaxHealth;
        ScoreType score         = new ScoreType(UnityEngine.SceneManagement.SceneManager.GetActiveScene().name, timeMSElapsed, scorePoints);

        score.SaveScore();

        // Fire the event that trail was completed
        if (CallOnTrailCompleted != null)
        {
            CallOnTrailCompleted(score);
        }
    }