private void TryToAttackEnemie() { Collider2D enemieInAttackArea = Physics2D.OverlapBox( transform.position, applicationArea, 0f, layerMask); if (enemieInAttackArea == null) { return; } var positionDifference = Mathf.Sign(enemieInAttackArea.transform.position.x - transform.position.x); if (!flip.isFacingRight && positionDifference == 1f || flip.isFacingRight && positionDifference == -1f) { flip.FlipObject(); } fighter.StartAttack(); illusionState = IllusionStates.Attack; }
public void IdleState() { illusionState = IllusionStates.Idle; }