Ejemplo n.º 1
0
    void Walk()
    {
        if (enemyMovementStorage.startPosX % 2 != transform.position.x % 2 || enemyMovementStorage.startPosZ % 2 != transform.position.z % 2)     //if its not the same
        {
            //enemyMovementStorage.RepairPosition(); //set the position to the last know good position
        }

        if (MoveCounter > 2)         //if taken more than 4 moves
        {
            shouldMove = false;
            if (_gameTurnController.CurrentState != GameTurnController.PlayerState.EnemyCombatTurn)             //if enemy did not attack in its turn
            {
                StartedMoving = false;
                _levelScript.CheckForMovement();                 //if the enemy stops, looks if other enemies are still moving
            }
        }
        else if (StartedMoving)
        {
            enemyMovementStorage.MoveEnemy();
        }
    }