void InitializeAStar() { pather_solids = new AStarPather(new MazeWalkerLambda((a, b) => { return(SolidTileIds.Contains(Gett(b)) ? int.MaxValue : 1 + GetStink(b)); }), new twinrect(0, 0, 19, 17)); stinkycells = new Dictionary <twin, float>(); }
public void InitializeManualTT() { var grid = tilemap.gameObject.GetComponentInParent <Grid>(); this.mazeMaster = grid.gameObject.GetComponent <maze.MazeMaster>(); if (this.mazeMaster == null) { this.mazeMaster = grid.gameObject.AddComponent <maze.MazeMaster>(); } this.mazeMaster.IsTileSolid = cell => { return(SolidTileIds.Contains(Gett(cell))); }; if (sprites.Length == 0) { Dj.Crashf("BaseTilemapXXI '{0}' has no sprites in its SpriteLot '{1}'. TiledLoader.SetupTileset will crash.", this.gameObject.name, sprites.gameObject.name); } loader.SetupTileset(sprites, SolidTileIds, SpawnTileIds); tts = new Dictionary <twin, int>(); }
bool IsSolidTile(twin cell) { return(SolidTileIds.Contains(Gett(cell))); }