Example #1
0
 public void GameOver()
 {
     Debug.Log("GameOver");
     StartPlay = false;
     NotificationCenter.Default.Post(this, NotificationKeys.GameOver);
     CameraShake(5, new Vector3(0.3f, 0.3f, 0));
     Cover.DOFade(1, 5).OnComplete(() =>
     {
         Cover.DOFade(0, 2);
         if (MonsterHp > RobotHp)//lose
         {
             Win.DOFade(0, 0);
             Lose.DOFade(1, 0);
         }
         else if (MonsterHp < RobotHp)//win
         {
             Win.DOFade(1, 0);
             Lose.DOFade(0, 0);
         }
         RestartButton.SetActive(true);
     });
 }