コード例 #1
0
    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);
        }
    }