Files
aibis-dream/Assets/Plugins/CleanFlatUI/Scripts/Utility/InputModuleSwitch.cs
T
2024-10-10 12:46:34 +08:00

27 lines
801 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
namespace RainbowArt.CleanFlatUI
{
public class InputModuleSwitch : MonoBehaviour
{
void Awake()
{
#if ENABLE_INPUT_SYSTEM
StandaloneInputModule inputModule = gameObject.GetComponent<StandaloneInputModule>();
if(inputModule)
{
Destroy(inputModule);
}
UnityEngine.InputSystem.UI.InputSystemUIInputModule newInputModule = gameObject.GetComponent<UnityEngine.InputSystem.UI.InputSystemUIInputModule>();
if (newInputModule == null)
{
gameObject.AddComponent<UnityEngine.InputSystem.UI.InputSystemUIInputModule>();
}
#endif
}
}
}