private void EnemyMove() { bool move = true; if (DirectionTravel_enemy == DirectionTravel.North) { move = bodyMovementWalking.StepNorth(); } if (DirectionTravel_enemy == DirectionTravel.South) { move = bodyMovementWalking.StepSouth(); } if (DirectionTravel_enemy == DirectionTravel.East) { move = bodyMovementWalking.StepEast(); } if (DirectionTravel_enemy == DirectionTravel.West) { move = bodyMovementWalking.StepWest(); } if (!move) { EnemyAttack(); } InMove = false; }
private IEnumerator DetermineAction() { bool move = true; OnUpdateDirections(); yield return(new WaitForSeconds(0.2f)); PlayerMove = gameController.SetPlayerMove(); if (PlayerMove) { if (DirectionTravel_player == DirectionTravel.North) { move = bodyMovementWalking.StepNorth(); } if (DirectionTravel_player == DirectionTravel.South) { move = bodyMovementWalking.StepSouth(); } if (DirectionTravel_player == DirectionTravel.East) { move = bodyMovementWalking.StepEast(); } if (DirectionTravel_player == DirectionTravel.West) { move = bodyMovementWalking.StepWest(); } if (!move) { AttackPlayer(); } StartCoroutine(WaitingForEndOfAction()); } }