diff --git a/BoneSync/BoneSync.csproj b/BoneSync/BoneSync.csproj
index d0251e1..25ba64e 100644
--- a/BoneSync/BoneSync.csproj
+++ b/BoneSync/BoneSync.csproj
@@ -98,6 +98,7 @@
+
diff --git a/BoneSync/Patching/ButtonTogglePatches.cs b/BoneSync/Patching/ButtonTogglePatches.cs
new file mode 100644
index 0000000..e4555d8
--- /dev/null
+++ b/BoneSync/Patching/ButtonTogglePatches.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using BoneSync.Sync;
+using BoneSync.Sync.Components;
+using HarmonyLib;
+using MelonLoader;
+using StressLevelZero.Interaction;
+using UnityEngine.Events;
+
+namespace BoneSync.Patching
+{
+ public class UnityEventPatch
+ {
+ private T arg;
+ private UnityEvent unityEvent;
+ private Action handler;
+ private UnityEventPatch(T arg, UnityEvent unityEvent, Action handler)
+ {
+ this.arg = arg;
+ this.unityEvent = unityEvent;
+ this.handler = handler;
+ }
+
+ private void Listener()
+ {
+ handler(arg);
+ }
+ private void PatchUnityEvent()
+ {
+ if (unityEvent == null) return;
+ unityEvent.AddListener((UnityAction)Listener);
+
+ }
+
+ public static void Patch(T arg, UnityEvent unityEvent, Action handler)
+ {
+ UnityEventPatch patch = new UnityEventPatch(arg, unityEvent, handler);
+ patch.PatchUnityEvent();
+ }
+ }
+
+ [HarmonyPatch(typeof(ButtonToggle))]
+ internal class ButtonTogglePatches
+ {
+ [HarmonyPatch(nameof(ButtonToggle.OnEnable)), HarmonyPostfix]
+ private static void OnEnablePostfix(ButtonToggle __instance)
+ {
+ Syncable syncable = ObjectSync.MakeOrGetSyncable(__instance);
+ }
+ }
+}
diff --git a/BoneSync/Patching/SceneManagerPatches.cs b/BoneSync/Patching/SceneManagerPatches.cs
index 3efbb97..4f86945 100644
--- a/BoneSync/Patching/SceneManagerPatches.cs
+++ b/BoneSync/Patching/SceneManagerPatches.cs
@@ -13,7 +13,7 @@ namespace BoneSync.Patching
[HarmonyPatch(typeof(BoneworksSceneManager))]
internal class SceneManagerPatches
{
- [HarmonyPatch(nameof(BoneworksSceneManager.LoadScene)), HarmonyPostfix]
+ /*[HarmonyPatch(nameof(BoneworksSceneManager.LoadScene)), HarmonyPostfix]
private static void LoadScenePrefix(int sceneBuildIndex)
{
MelonLogger.Msg("LoadScenePrefix: " + sceneBuildIndex);
@@ -23,6 +23,6 @@ namespace BoneSync.Patching
MelonLogger.Msg("Host is loading scene, sending message to clients...");
SceneSync.SendSceneSyncMessage(sceneBuildIndex);
}
- }
+ }*/
}
}
diff --git a/BoneSync/Sync/Components/SyncablePhysics.cs b/BoneSync/Sync/Components/SyncablePhysics.cs
index ce94609..7ffb379 100644
--- a/BoneSync/Sync/Components/SyncablePhysics.cs
+++ b/BoneSync/Sync/Components/SyncablePhysics.cs
@@ -14,18 +14,6 @@ using UnityEngine;
using UnityEngine.Events;
namespace BoneSync.Sync.Components
{
- public static class UnityEventExtentions
- {
- public static void AddListenerWithArgsRaw(this UnityEvent unityEvent, Action