예제 #1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         uiManege.dead();
     }
 }
예제 #2
0
 void FixedUpdate()
 {
     if (inGame)
     {
         if (!death)
         {
             if (transform.position.x < Camera.main.ScreenToWorldPoint(new Vector2(0, 0)).x)
             {
                 uiManege.dead();
             }
             if (onFloor)
             {
                 animation.SetBool("floor", true);
                 walke();
                 if (Input.GetKeyUp(KeyCode.A))
                 {
                     rigidbody.AddForce(Vector2.up * speed * 40);
                     onFloor = false;
                 }
             }
             if (!onFloor)
             {
                 animation.SetBool("floor", false);
                 jump();
             }
         }
         else
         {
             if (readyToDie)
             {
                 dead();
             }
         }
     }
 }