Exemplo n.º 1
0
    [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)
    }
Exemplo n.º 2
0
 public GridPlacement(GameGenerator2 gameGen)
 {
     GameGen    = gameGen;
     GridPoints = new GridPoint[GridSize, GridSize];
     GenRan     = new GenerationRandom(gameGen.Seed);
     GPF        = new GridPathFinder(this);
 }
Exemplo n.º 3
0
 protected void Awake()
 {
     base.Awake();
     Instance           = this;
     m_PathFindingTiles = new List <Tile> ();
     m_DestinationTiles = new List <Tile> ();
     m_MoveRangeTiles   = new HashSet <Tile> ();
 }
Exemplo n.º 4
0
 public void Initialize(GridPathFinder pathFinder)
 {
     this.pathFinder = pathFinder;
     chooseRandomObjective();
     isInitialize = true;
 }