Пример #1
0
 void OnCollisionEnter2D(Collision2D other)
 {
     if (other.gameObject.tag == "kill")
     {
         theGameManager.RestartGame();
         moveSpeed              = moveSpeedStore;
         speedMilestoneCount    = speedMilestoneCountStore;
         speedIncreaseMilestone = speedIncreaseMilestoneStore;
         deathSound.Play();
     }
 }
Пример #2
0
 void OnCollisionEnter2D(Collision2D other) //kun boxcolliderit kohtaa
 {
     if (other.gameObject.tag == "killbox")
     {
         theGameManager.RestartGame();
         moveSpeed              = moveSpeedStore;
         speedMilestoneCount    = speedMilestoneCountStore;
         speedIncreaseMilestone = speedIncreaseMilestoneStore;
     }
     Debug.Log("collision");
 }
 void OnCollisionEnter2D(Collision2D other)
 {
     if (other.gameObject.tag == "killbox")
     {
         theGameManager.RestartGame();
         speed = moveSpeedStore;
         speedMilestoneCount    = speedMilestoneCountStore;
         speedIncreaseMilestone = speedIncreaseMilestoneStore;
     }
     grounded      = true;
     canJump       = true;
     canDoubleJump = false;
     Debug.Log("collision");
 }