private void RegisterCallbacks(PriorityCallbacks <DungeonGeneratorPostProcessCallback> callbacks) { if (config.InitializeSharedTilemaps) { callbacks.RegisterCallback(PostProcessPriorities.InitializeSharedTilemaps, (level, description) => { // PostProcessUtils.InitializeSharedTilemaps(level, tilemapLayersHandler, config.TilemapMaterial); PostProcessUtils.InitializeSharedTilemaps(level, config.TilemapLayersStructure, defaultTilemapLayersHandlerFactory(), config.TilemapLayersHandler, config.TilemapLayersExample, config.TilemapMaterial); PostProcessUtils.SetTilemapsMaterial(level, config.TilemapMaterial); }); } if (config.CopyTilesToSharedTilemaps) { callbacks.RegisterCallback(PostProcessPriorities.CopyTilesToSharedTilemaps, (level, description) => { PostProcessUtils.CopyTilesToSharedTilemaps(level); }); } if (config.CenterGrid) { callbacks.RegisterCallback(PostProcessPriorities.CenterGrid, (level, description) => { PostProcessUtils.CenterGrid(level); }); } if (config.DisableRoomTemplatesRenderers) { callbacks.RegisterCallback(PostProcessPriorities.DisableRoomTemplateRenderers, (level, description) => { PostProcessUtils.DisableRoomTemplatesRenderers(level); }); } if (config.DisableRoomTemplatesColliders) { callbacks.RegisterCallback(PostProcessPriorities.DisableRoomTemplateColliders, (level, description) => { PostProcessUtils.DisableRoomTemplatesColliders(level); }); } }
/// <summary> /// Position the grid so that the level is centered at (0,0). /// </summary> /// <param name="level"></param> /// <param name="compressBounds">Whether to compress bounds of individual tilemaps before computing the center.</param> public static void CenterGrid(DungeonGeneratorLevelGrid2D level, bool compressBounds = false) { PostProcessUtils.CenterGrid(level, compressBounds); }