コード例 #1
0
 private void HandleRunEvent(RunPhase phase, float time)
 {
     if (phase == RunPhase.Start)
     {
         currentStartTime = time;
         bool             show  = GeneralManager.HasRun();
         SpriteRenderer[] rends = GetComponentsInChildren <SpriteRenderer>();
         for (int i = 0; i < rends.Length; i++)
         {
             rends[i].enabled = show;
         }
     }
     else if (phase == RunPhase.Goal)
     {
         currentGoalTime = time;
         float currentTime = currentGoalTime - currentStartTime;
         if (GeneralManager.IsPersonalRunRecord(currentTime))
         {
             GeneralManager.SetRunRecording(currentRun);
         }
         currentRun.Clear();
         SpriteRenderer[] rends = GetComponentsInChildren <SpriteRenderer>();
         for (int i = 0; i < rends.Length; i++)
         {
             rends[i].enabled = false;
         }
     }
 }