Initial commit
This commit is contained in:
parent
1af2b57c1c
commit
eebf00988e
30 changed files with 1883 additions and 21 deletions
46
DunGenPlus/DunGenPlus/Managers/DoorwayManager.cs
Normal file
46
DunGenPlus/DunGenPlus/Managers/DoorwayManager.cs
Normal file
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DunGen.Adapters;
|
||||
using DunGenPlus.Components;
|
||||
using DunGenPlus.Generation;
|
||||
using DunGenPlus.Utils;
|
||||
|
||||
namespace DunGenPlus.Managers {
|
||||
public static class DoorwayManager {
|
||||
|
||||
public static ActionList onMainEntranceTeleportSpawnedEvent = new ActionList("onMainEntranceTeleportSpawned");
|
||||
public static List<DoorwayCleanup> doorwayCleanupList;
|
||||
|
||||
public static void ResetList(){
|
||||
doorwayCleanupList = new List<DoorwayCleanup>();
|
||||
}
|
||||
|
||||
public static void AddDoorwayCleanup(DoorwayCleanup cleanup){
|
||||
doorwayCleanupList.Add(cleanup);
|
||||
}
|
||||
|
||||
public static void onMainEntranceTeleportSpawnedFunction(){
|
||||
if (DunGenPlusGenerator.Active) {
|
||||
foreach(var d in doorwayCleanupList){
|
||||
d.SetBlockers(false);
|
||||
d.Cleanup();
|
||||
}
|
||||
|
||||
try{
|
||||
var dungeonGen = RoundManager.Instance.dungeonGenerator;
|
||||
var navmesh = dungeonGen.transform.parent.GetComponentInChildren<UnityNavMeshAdapter>();
|
||||
navmesh.Run(dungeonGen.Generator);
|
||||
Plugin.logger.LogInfo("Rebuild nav mesh");
|
||||
} catch (Exception e){
|
||||
Plugin.logger.LogError("Failed to rebuild nav mesh");
|
||||
Plugin.logger.LogError(e.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue