mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-17 14:37:49 +08:00
Prevent null reference if Canvas isn't created yet
This commit is contained in:
parent
d0e508727a
commit
084aee617c
@ -160,6 +160,16 @@ namespace UnityExplorer.Core.Input
|
|||||||
|
|
||||||
public static void Prefix_EventSystem_set_current(ref EventSystem value)
|
public static void Prefix_EventSystem_set_current(ref EventSystem value)
|
||||||
{
|
{
|
||||||
|
if (!UIManager.EventSys)
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
lastEventSystem = value;
|
||||||
|
lastInputModule = value.currentInputModule;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!settingEventSystem && value != UIManager.EventSys)
|
if (!settingEventSystem && value != UIManager.EventSys)
|
||||||
{
|
{
|
||||||
lastEventSystem = value;
|
lastEventSystem = value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user