diff --git a/src/Core/Input/CursorUnlocker.cs b/src/Core/Input/CursorUnlocker.cs index 86a218a..ab5dc9a 100644 --- a/src/Core/Input/CursorUnlocker.cs +++ b/src/Core/Input/CursorUnlocker.cs @@ -89,34 +89,29 @@ namespace UnityExplorer.Core.Input public static void SetEventSystem() { - // not overriding EventSystem for new InputSystem, dont seem to need to. if (InputManager.CurrentType == InputType.InputSystem) return; - // Disable current event system object - if (m_lastEventSystem || EventSystem.current) + if (EventSystem.current && EventSystem.current != UIManager.EventSys) { - if (!m_lastEventSystem) - m_lastEventSystem = EventSystem.current; - + m_lastEventSystem = EventSystem.current; m_lastEventSystem.enabled = false; } // Set to our current system m_settingEventSystem = true; - EventSystem.current = UIManager.EventSys; UIManager.EventSys.enabled = true; + EventSystem.current = UIManager.EventSys; InputManager.ActivateUIModule(); m_settingEventSystem = false; } public static void ReleaseEventSystem() { - // not overriding EventSystem for new InputSystem, dont seem to need to. if (InputManager.CurrentType == InputType.InputSystem) return; - if (m_lastEventSystem) + if (m_lastEventSystem && m_lastEventSystem.gameObject.activeSelf) { m_lastEventSystem.enabled = true; @@ -153,13 +148,16 @@ namespace UnityExplorer.Core.Input public static void Prefix_EventSystem_set_current(ref EventSystem value) { - if (!m_settingEventSystem) + if (!m_settingEventSystem && value != UIManager.EventSys) { m_lastEventSystem = value; m_lastInputModule = value?.currentInputModule; if (ShouldActuallyUnlock) + { value = UIManager.EventSys; + value.enabled = true; + } } } diff --git a/src/ExplorerCore.cs b/src/ExplorerCore.cs index ca646ae..77affc0 100644 --- a/src/ExplorerCore.cs +++ b/src/ExplorerCore.cs @@ -13,7 +13,7 @@ namespace UnityExplorer public class ExplorerCore { public const string NAME = "UnityExplorer"; - public const string VERSION = "3.3.9"; + public const string VERSION = "3.3.10"; public const string AUTHOR = "Sinai"; public const string GUID = "com.sinai.unityexplorer"; diff --git a/src/Loader/ML/ExplorerMelonMod.cs b/src/Loader/ML/ExplorerMelonMod.cs index 47f6db7..f01094c 100644 --- a/src/Loader/ML/ExplorerMelonMod.cs +++ b/src/Loader/ML/ExplorerMelonMod.cs @@ -13,6 +13,7 @@ using UnityExplorer.Loader.ML; [assembly: MelonInfo(typeof(ExplorerMelonMod), ExplorerCore.NAME, ExplorerCore.VERSION, ExplorerCore.AUTHOR)] [assembly: MelonGame(null, null)] +//[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.UNIVERSAL)] namespace UnityExplorer {