private void Awake() { lastSoundTime = Time.time; _speaker = GetComponent <Speaker>(); ClickToMoveController ctmc = GetComponentInChildren <ClickToMoveController>(); ctmc.OnNavigationFailed += NavigationFailedEvent; _tileLookup = floor.GetComponent <TileLookup>(); }
public bool HandleReplaceTileCollision(TmxLayerTile tile, TileLookupEnum collisionTile, TileLookupEnum newTile) { if (tile.Gid != TileLookup.GetTileValue(collisionTile)) { return(false); } //_detailLayer.RemoveTile(tile.X, tile.Y); tile.Gid = TileLookup.GetTileValue(newTile); _tiledMapRenderer.CollisionLayer.RemoveTile(tile.X, tile.Y); return(true); }
public RenderedTileInfo(TileData tileType, Vector3 location, float rotation, TileNode sourceNode, GameObject graphHolder) { this.tileType = tileType; placedTile = Object.Instantiate(tileType.prefab, location, Quaternion.Euler(0, rotation, 0), graphHolder.transform); TileLookup curr = placedTile.AddComponent <TileLookup>(); curr.AddRenderedTileInfo(this); this.location = location; this.rotation = rotation; this.sourceNode = sourceNode; this.graphHolder = graphHolder; doors = new bool[tileType.doorLocs.Length]; currDoor = sourceNode.seed % tileType.doorLocs.Length; connectedTiles = new List <RenderedTileInfo>(); CheckForDoors(); }