void OnTriggerExit2D(Collider2D collider) { if (collider.GetType() == typeof(BoxCollider2D)) { if (collider.gameObject.layer == 8) { m_AlienState = AlienAIState.Idle; } } }
void OnTriggerEnter2D(Collider2D collider) { if (collider.gameObject.layer == 8) { if (collider.GetType() == typeof(BoxCollider2D)) { m_AlienState = AlienAIState.Attacking; m_Target = collider.gameObject; } if (collider.GetType() == typeof(CircleCollider2D)) { m_Animator.SetBool("isAttacking", true); } } }