Пример #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (ai.Ai_Trigger(collision))
     {
         anim.SetBool("hit", true);
     }
 }
Пример #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (ai.Ai_Trigger(collision))
     {
         GetComponent <Animator>().SetBool("hit", true);
     }
 }
Пример #3
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (!isDie && !isFirstHit && collision.gameObject.CompareTag("PlayerFoot"))
     {
         FindObjectOfType <AudioManager>().Play("Enemy Death");
         collision.transform.parent.GetComponent <PlayerController>().JumpPlayer();
         isFirstHit = true;
         isDie      = true;
         return;
     }
     else if (ai.Ai_Trigger(collision))
     {
         anim.SetBool("isDie", true);
         isDie   = true;
         enabled = false;
     }
 }
Пример #4
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (!isDie && ai.Ai_Trigger(collision, GreenDie))
     {
         isDie = true;
         if (!GreenDie)
         {
             GreenDie = true;
             ai.SetEnemyDie(false);
             anim.SetTrigger("hit");
             ai.speed *= angrySpeed;
             ai.SetTime(0);
         }
         else
         {
             anim.SetBool("isDie", true);
         }
     }
 }