[SerializeField] ParticleSystem destructionVFX; //emitted when enemy is self-destructs (prefab) // Start is called before the first frame update void Start() { GridPathFinder gridPathFinder = FindObjectOfType <GridPathFinder>(); //get a reference to the grid path finder (by finding object of its type since there's only one) List <Cell> enemeyPath = gridPathFinder.getSpawnToPlayerBasePath(); //make sure the enemy has access to the path from grid path finder StartCoroutine(FollowCellsInPath(enemeyPath)); //coroutine allows for parallel execution and time delay (we specify where and for how long to delay in the routine method) }
public GridPlacement(GameGenerator2 gameGen) { GameGen = gameGen; GridPoints = new GridPoint[GridSize, GridSize]; GenRan = new GenerationRandom(gameGen.Seed); GPF = new GridPathFinder(this); }
protected void Awake() { base.Awake(); Instance = this; m_PathFindingTiles = new List <Tile> (); m_DestinationTiles = new List <Tile> (); m_MoveRangeTiles = new HashSet <Tile> (); }
public void Initialize(GridPathFinder pathFinder) { this.pathFinder = pathFinder; chooseRandomObjective(); isInitialize = true; }