Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 3628f3d

Browse files
committed
Fix event system control
1 parent d39fea6 commit 3628f3d

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/Core/Input/CursorUnlocker.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,34 +89,29 @@ public static void UpdateCursorControl()
8989

9090
public static void SetEventSystem()
9191
{
92-
// not overriding EventSystem for new InputSystem, dont seem to need to.
9392
if (InputManager.CurrentType == InputType.InputSystem)
9493
return;
9594

96-
// Disable current event system object
97-
if (m_lastEventSystem || EventSystem.current)
95+
if (EventSystem.current && EventSystem.current != UIManager.EventSys)
9896
{
99-
if (!m_lastEventSystem)
100-
m_lastEventSystem = EventSystem.current;
101-
97+
m_lastEventSystem = EventSystem.current;
10298
m_lastEventSystem.enabled = false;
10399
}
104100

105101
// Set to our current system
106102
m_settingEventSystem = true;
107-
EventSystem.current = UIManager.EventSys;
108103
UIManager.EventSys.enabled = true;
104+
EventSystem.current = UIManager.EventSys;
109105
InputManager.ActivateUIModule();
110106
m_settingEventSystem = false;
111107
}
112108

113109
public static void ReleaseEventSystem()
114110
{
115-
// not overriding EventSystem for new InputSystem, dont seem to need to.
116111
if (InputManager.CurrentType == InputType.InputSystem)
117112
return;
118113

119-
if (m_lastEventSystem)
114+
if (m_lastEventSystem && m_lastEventSystem.gameObject.activeSelf)
120115
{
121116
m_lastEventSystem.enabled = true;
122117

@@ -153,13 +148,16 @@ private static void SetupPatches()
153148

154149
public static void Prefix_EventSystem_set_current(ref EventSystem value)
155150
{
156-
if (!m_settingEventSystem)
151+
if (!m_settingEventSystem && value != UIManager.EventSys)
157152
{
158153
m_lastEventSystem = value;
159154
m_lastInputModule = value?.currentInputModule;
160155

161156
if (ShouldActuallyUnlock)
157+
{
162158
value = UIManager.EventSys;
159+
value.enabled = true;
160+
}
163161
}
164162
}
165163

src/ExplorerCore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace UnityExplorer
1313
public class ExplorerCore
1414
{
1515
public const string NAME = "UnityExplorer";
16-
public const string VERSION = "3.3.9";
16+
public const string VERSION = "3.3.10";
1717
public const string AUTHOR = "Sinai";
1818
public const string GUID = "com.sinai.unityexplorer";
1919

src/Loader/ML/ExplorerMelonMod.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
[assembly: MelonInfo(typeof(ExplorerMelonMod), ExplorerCore.NAME, ExplorerCore.VERSION, ExplorerCore.AUTHOR)]
1515
[assembly: MelonGame(null, null)]
16+
//[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.UNIVERSAL)]
1617

1718
namespace UnityExplorer
1819
{

0 commit comments

Comments
 (0)