public void UpdateExclusionZone() { if (exclusionZone == null) { exclusionZone = GetComponent <EnemySpawnExclusionZone>(); } var firstEnemyPathNode = pathManager.GetActivePath().GetExtrapolator().GetMinimalRepresentation().First(); Debug.Assert(firstEnemyPathNode.OutgoingDirection != null, "firstEnemyPathNode.OutgoingDirection != null"); exclusionZone.SetDirection(firstEnemyPathNode.Location, firstEnemyPathNode.OutgoingDirection.Value); }
public void UpdateExclusionZone() { if (exclusionZone == null) { exclusionZone = GetComponent <MotherboardExclusionZone>(); } var lastEnemyPathNode = pathManager.GetActivePath().GetExtrapolator().GetMinimalRepresentation().Last(); Debug.Assert(lastEnemyPathNode.IncomingDirection != null, "firstEnemyPathNode.IncomingDirection != null"); exclusionZone.SetDirection(lastEnemyPathNode.Location, lastEnemyPathNode.IncomingDirection.Value.Opposite()); }
private void Awake() { // in theory, this can be done without allocation. var minimal = pathManager.GetActivePath().GetExtrapolator().GetMinimalRepresentation().ToList(); foreach (var zone in exclusionZoneMonoBehaviours) { exclusionZones.Add(zone); } for (var i = 0; i < minimal.Count - 1; i++) { var first = minimal[i].Location; var second = minimal[i + 1].Location; exclusionZones.Add(new RectangleExclusionZone(first, second)); } selectionManager = GetComponent <TileSelectionManager>(); focusManager = GetComponent <TileFocusManager>(); TileGrid = new ExclusionCheckedTileGrid(new Dimensions <int>(21, 13), manager, selectionManager, focusManager, tilePrefab, exclusionZones); }
private void Awake() { grid = new PathGrid(new Dimensions <int>(21, 13), enemyPathManager.GetActivePath(), pathGridPrefab); }