Updated Editor create options to add the correct Event System Input module for the Input system used, now or old.

Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/378
pull/413/head
Simon Jackson 2023-01-01 11:33:42 +00:00
parent 1853ad7e89
commit 2c5a7bb47f
2 changed files with 70 additions and 57 deletions

View File

@ -1,9 +1,17 @@
using TMPro;
#if UNITY_2019_1_OR_NEWER && !ENABLE_LEGACY_INPUT_MANAGER
#define NEW_INPUT_SYSTEM
#endif
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using UnityEngine.UI.Extensions;
#if NEW_INPUT_SYSTEM
using UnityEngine.InputSystem.UI;
#endif
namespace UnityEditor.UI
{
/// <summary>
@ -157,7 +165,11 @@ namespace UnityEditor.UI
var eventSystem = new GameObject("EventSystem");
GameObjectUtility.SetParentAndAlign(eventSystem, parent);
esys = eventSystem.AddComponent<EventSystem>();
#if NEW_INPUT_SYSTEM
eventSystem.AddComponent<InputSystemUIInputModule>();
#else
eventSystem.AddComponent<StandaloneInputModule>();
#endif
Undo.RegisterCreatedObjectUndo(eventSystem, "Create " + eventSystem.name);
}

View File

@ -5,7 +5,8 @@
"GUID:343deaaf83e0cee4ca978e7df0b80d21",
"GUID:2bafac87e7f4b9b418d9448d219b01ab",
"GUID:cf414061cae3a954baf92763590f3127",
"GUID:6055be8ebefd69e48b49212b09b47b2f"
"GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:75469ad4d38634e559750d17036d5f7c"
],
"includePlatforms": [
"Editor"