private void CreateSpecialTile(DS1.Cell cell, int x, int y, Transform parent) { // debug visualization DT1.Tile tile; if (specialTiles.Sample(cell.tileIndex, out tile)) { var renderer = CreateTile(tile, x, y, parent: parent); renderer.gameObject.layer = UnityLayers.SpecialTiles; } if (info == null) { return; } if (cell.mainIndex < 8) { int targetLevelId = info.vis[cell.mainIndex]; int warpId = info.warp[cell.mainIndex]; var targetLevel = LevelInfo.Find(targetLevelId); var levelWarpInfo = LevelWarpInfo.Find(warpId); if (levelWarpInfo == null) { Debug.LogWarning("Warp info wasn't found"); return; } Warp.Create(x, y, levelWarpInfo, info, targetLevel, parent); } }
private void PutToPopup(DS1.Cell cell, Renderer renderer, int x, int y) { Popup popup = null; foreach (Popup iter in popups) { if ((cell.orientation != 15 || iter.tileIndex == cell.mainIndex) && iter.scanArea.Contains(x, y)) { popup = iter; break; } } if (popup == null) { return; } if (cell.orientation == 15) { popup.roofs.Add(renderer); } else if (cell.orientation == 5 || cell.orientation == 6 || (x != popup.triggerArea.xMin && y != popup.triggerArea.yMax)) { popup.walls.Add(renderer); } }
private void CreateSpecialTile(DS1.Cell cell, int x, int y, Transform parent) { // debug visualization if (specialTiles.Sample(cell.tileIndex, out var tile)) { WorldState.instance.Grid.PutSpecialTile(tile, x, y); } if (info == null) { return; } if (cell.mainIndex < 8) { int targetLevelId = info.vis[cell.mainIndex]; int warpId = info.warp[cell.mainIndex]; var targetLevel = LevelInfo.Find(targetLevelId); var levelWarpInfo = LevelWarpInfo.Find(warpId); if (levelWarpInfo == null) { Debug.LogWarning("Warp info wasn't found"); return; } Warp.Create(x, y, levelWarpInfo, info, targetLevel, parent); } }
private void PutToPopup(DS1.Cell cell, Renderer renderer, int x, int y) { foreach (Popup popup in popups) { if (popup.revealMainIndex == cell.mainIndex && popup.revealArea.Contains(x, y)) { popup.roofs.Add(renderer); } } }