コード例 #1
0
ファイル: Health.cs プロジェクト: tangt07/The-Milk-Project
 private void DeadCheck()
 {
     if (health <= minhealth)
     {
         health = minhealth;
         if (!dead)
         {
             dead = true;
             anim.SetBool("Ground", true);
             anim.SetTrigger("Die");
             //anim.CrossFade("MP_die",0f);
             //Destroy(gameObject,3f);
             if (currentTag == "Player")
             {
                 playermovement.Move(Vector2.zero);
                 playermovement.enable = false;
             }
         }
     }
     else
     {
         if (dead)
         {
             dead = false;
             //Revive
             if (currentTag == "Player")
             {
                 playermovement.enable = true;
             }
         }
     }
 }
コード例 #2
0
 private void FixedUpdate()
 {
     _playerMovement.Move(new Vector3(xInput, 0f, yInput));
 }