Files
Cielonos/Assets/Plugins/FlexibleUI/Demos/Scripts/InputModuleReplacer.cs
SoulliesOfficial 649b7a5ddc 更新
2026-05-23 08:27:50 -04:00

25 lines
605 B
C#

using UnityEngine;
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
using UnityEngine.EventSystems;
using UnityEngine.InputSystem.UI;
#endif
namespace JeffGrawAssets.FlexibleUI
{
public class InputModuleReplacer : MonoBehaviour
{
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
void Awake()
{
var standaloneInputModule = GetComponent<StandaloneInputModule>();
if (standaloneInputModule != null)
{
Destroy(standaloneInputModule);
gameObject.AddComponent<InputSystemUIInputModule>();
}
Destroy(this);
}
#endif
}
}