Exemplo n.º 1
0
 private void stepForward(Vector2 directionVector)
 {
     TargetUnitPosition = UnitPosition + directionVector;
     if (!PlayGrid.checkIfOutOfBounds(TargetUnitPosition))
     {
         // Take a step forward (update current NPCreature position)
         gameObject.GetComponent <Transform>().position = PlayGrid.getGridCoordinates(TargetUnitPosition);
     }
     else
     {
         // flip direction vector
         gameObject.transform.Rotate(0, 0, 180);
     }
 }