public void Build(IDungeonSceneObjectInstantiator objectInstantiator) { NotifyPreBuild(); Initialize(); dungeonModel.ResetModel(); dungeonBuilder.BuildDungeon(config, dungeonModel); markers = dungeonBuilder.PropSockets; NotifyPostLayoutBuild(); if (dungeonBuilder.IsThemingSupported()) { ReapplyTheme(objectInstantiator); } else { dungeonBuilder.BuildNonThemedDungeon(sceneProvider, objectInstantiator); } // Build the navigation var navigation = GetComponent <DungeonRuntimeNavigation>(); if (navigation != null) { navigation.BuildNavMesh(); } NotifyPostBuild(); }
/// <summary> /// Builds the dungeon layout /// </summary> /// <param name="config">The builder configuration</param> /// <param name="model">The dungeon model that the builder will populate</param> public virtual void BuildDungeon(DungeonConfig config, DungeonModel model) { this.config = config; this.model = model; nrandom = new PMRandom(config.Seed); random = new PMRandom(config.Seed); propSockets = CreateMarkerListObject(config); isLayoutBuilt = true; }
void NotifyMarkersEmitted(LevelMarkerList markers) { // Notify all listeners of the post build event foreach (var listener in GetListeners()) { if (listener == null) { continue; } listener.OnDungeonMarkersEmitted(this, ActiveModel, markers); } }
/// <summary> /// Called after all the markers have been emitted for the level (but before the theming engine is run on those markers) /// This gives you an opportunity to modify the markers /// </summary> /// <param name="dungeon"></param> /// <param name="model"></param> public virtual void OnDungeonMarkersEmitted(Dungeon dungeon, DungeonModel model, LevelMarkerList markers) { }