Skip to content

Commit

Permalink
Fixed everything up
Browse files Browse the repository at this point in the history
  • Loading branch information
nrgill28 committed May 2, 2021
1 parent bf7e34b commit 0df15b4
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
9 changes: 9 additions & 0 deletions WorkbenchEditorScripts/TNH_EncryptionSpawnPoint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using UnityEngine;

namespace FistVR
{
public class TNH_EncryptionSpawnPoint : MonoBehaviour
{
public bool[] AllowedSpawns = new bool[11];
}
}
1 change: 1 addition & 0 deletions WurstMod/MappingComponents/Generic/CustomScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion WurstMod/MappingComponents/Generic/HandTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public override void OnExport(ExportErrors err)
{
// This needs to be a trigger on the interactable layer
GetComponent<Collider>().isTrigger = true;
gameObject.layer = LayerMask.NameToLayer("HandTrigger");
gameObject.layer = LayerMask.NameToLayer("Interactable");
}
#endif
}
Expand Down
5 changes: 5 additions & 0 deletions WurstMod/Runtime/SceneLoaders/CustomSceneLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public virtual void PostLoad()
/// </summary>
public virtual void Resolve()
{
if (ObjectReferences.AIManager)
{
ObjectReferences.AIManager.NumEntitiesToCheckPerFrame =
ObjectReferences.CustomScene.NumEntitiesToCheckPerFrame;
}
}

public static CustomSceneLoader GetSceneLoaderForGamemode(string gamemode)
Expand Down
4 changes: 0 additions & 4 deletions WurstMod/Runtime/SceneLoaders/TakeAndHoldSceneLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions WurstMod/UnityEditor/SceneExporters/TakeAndHoldExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0df15b4

Please sign in to comment.