public void SetDirection(GridLocation spawnLocation, CardinalDirection direction)
 {
     if (direction == CardinalDirection.North || direction == CardinalDirection.South)
     {
         Zone = new RectangleExclusionZone(
             new GridLocation(spawnLocation.Row - verticalWidth / 2, spawnLocation.Column - horizontalWidth / 2),
             new GridLocation(spawnLocation.Row + verticalWidth / 2, spawnLocation.Column + horizontalWidth + 2));
     }
     else
     {
         Zone = new RectangleExclusionZone(
             new GridLocation(spawnLocation.Row - horizontalWidth / 2, spawnLocation.Column - verticalWidth / 2),
             new GridLocation(spawnLocation.Row + horizontalWidth / 2, spawnLocation.Column + verticalWidth / 2)
             );
     }
 }
Exemple #2
0
 public void Awake()
 {
     Zone = new RectangleExclusionZone(startLocation, endLocation);
 }