From 0df15b49ab3111e72d01fdb2d9b76946bc8f57ab Mon Sep 17 00:00:00 2001 From: Nathan Gill Date: Sat, 1 May 2021 22:51:04 -0400 Subject: [PATCH] Fixed everything up --- WorkbenchEditorScripts/TNH_EncryptionSpawnPoint.cs | 9 +++++++++ WurstMod/MappingComponents/Generic/CustomScene.cs | 1 + WurstMod/MappingComponents/Generic/HandTrigger.cs | 2 +- WurstMod/Runtime/SceneLoaders/CustomSceneLoader.cs | 5 +++++ WurstMod/Runtime/SceneLoaders/TakeAndHoldSceneLoader.cs | 4 ---- .../UnityEditor/SceneExporters/TakeAndHoldExporter.cs | 2 -- 6 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 WorkbenchEditorScripts/TNH_EncryptionSpawnPoint.cs diff --git a/WorkbenchEditorScripts/TNH_EncryptionSpawnPoint.cs b/WorkbenchEditorScripts/TNH_EncryptionSpawnPoint.cs new file mode 100644 index 0000000..26436d6 --- /dev/null +++ b/WorkbenchEditorScripts/TNH_EncryptionSpawnPoint.cs @@ -0,0 +1,9 @@ +using UnityEngine; + +namespace FistVR +{ + public class TNH_EncryptionSpawnPoint : MonoBehaviour + { + public bool[] AllowedSpawns = new bool[11]; + } +} \ No newline at end of file diff --git a/WurstMod/MappingComponents/Generic/CustomScene.cs b/WurstMod/MappingComponents/Generic/CustomScene.cs index 6a0e8c3..eb9486d 100644 --- a/WurstMod/MappingComponents/Generic/CustomScene.cs +++ b/WurstMod/MappingComponents/Generic/CustomScene.cs @@ -23,6 +23,7 @@ public class CustomScene : ComponentProxy [HideInInspector] public StringKeyValue[] ExtraData; [Header("Scene Settings")] public float MaxProjectileRange = 500f; + [Header("AI Settings")] public int NumEntitiesToCheckPerFrame = 1; public int PlayerIFF = 0; diff --git a/WurstMod/MappingComponents/Generic/HandTrigger.cs b/WurstMod/MappingComponents/Generic/HandTrigger.cs index d254774..8d6c141 100644 --- a/WurstMod/MappingComponents/Generic/HandTrigger.cs +++ b/WurstMod/MappingComponents/Generic/HandTrigger.cs @@ -21,7 +21,7 @@ public override void OnExport(ExportErrors err) { // This needs to be a trigger on the interactable layer GetComponent().isTrigger = true; - gameObject.layer = LayerMask.NameToLayer("HandTrigger"); + gameObject.layer = LayerMask.NameToLayer("Interactable"); } #endif } diff --git a/WurstMod/Runtime/SceneLoaders/CustomSceneLoader.cs b/WurstMod/Runtime/SceneLoaders/CustomSceneLoader.cs index 9e0f488..17cf805 100644 --- a/WurstMod/Runtime/SceneLoaders/CustomSceneLoader.cs +++ b/WurstMod/Runtime/SceneLoaders/CustomSceneLoader.cs @@ -51,6 +51,11 @@ public virtual void PostLoad() /// public virtual void Resolve() { + if (ObjectReferences.AIManager) + { + ObjectReferences.AIManager.NumEntitiesToCheckPerFrame = + ObjectReferences.CustomScene.NumEntitiesToCheckPerFrame; + } } public static CustomSceneLoader GetSceneLoaderForGamemode(string gamemode) diff --git a/WurstMod/Runtime/SceneLoaders/TakeAndHoldSceneLoader.cs b/WurstMod/Runtime/SceneLoaders/TakeAndHoldSceneLoader.cs index bde6a94..d2c787a 100644 --- a/WurstMod/Runtime/SceneLoaders/TakeAndHoldSceneLoader.cs +++ b/WurstMod/Runtime/SceneLoaders/TakeAndHoldSceneLoader.cs @@ -51,10 +51,6 @@ public override void Resolve() // Safe Pos Matrix needs to be set. Diagonal for now. TNH_SafePositionMatrix maxMatrix = GenerateTestMatrix(); _tnhManager.SafePosMatrix = maxMatrix; - - // Set this AI value. Does performance stuff - if (LevelRoot.ExtraData != null && LevelRoot.ExtraData.Length >= 2) - ObjectReferences.AIManager.NumEntitiesToCheckPerFrame = int.Parse(LevelRoot.ExtraData[1].Value); } /// diff --git a/WurstMod/UnityEditor/SceneExporters/TakeAndHoldExporter.cs b/WurstMod/UnityEditor/SceneExporters/TakeAndHoldExporter.cs index 0e18c9d..4ddbc4b 100644 --- a/WurstMod/UnityEditor/SceneExporters/TakeAndHoldExporter.cs +++ b/WurstMod/UnityEditor/SceneExporters/TakeAndHoldExporter.cs @@ -30,11 +30,9 @@ public override CustomScene.StringKeyValue[] OnExporterGUI(CustomScene.StringKey if (customData == null || customData.Length != 1) customData = new[] { new CustomScene.StringKeyValue {Key = "HoldOrder"}, - new CustomScene.StringKeyValue {Key = "NumEntitiesToCheckPerFrame", Value = "1"} }; customData[0].Value = EditorGUILayout.TextField("Hold Order", customData[0].Value); - customData[1].Value = EditorGUILayout.TextField("Num Entities To Check Per Frame", customData[1].Value); return customData; }