Example #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.name == "Player")
     {
         Destroy(collision.gameObject.GetComponent <StormWall> ());
         controller.Invoke("CreateNewMaze", 0);
     }
 }
 void fall()
 {
     if (this.gameObject.name == "Player")
     {
         if (isOutsideStorm())
         {
             controller.Invoke("WaitForRestart", 0);
         }
     }
     else if (!rigidBodyInvoked)
     {
         this.Invoke("addRigidBody", .5f);
         rigidBodyInvoked = true;
     }
 }