using System;
using UnityEngine;
using UnityEngine.EventSystems;

namespace AvatarSDKMove
{
    /// <summary>Uses the host project's input backend without requiring the Input System package.</summary>
    [RequireComponent(typeof(EventSystem))]
    public sealed class SampleInputModule : MonoBehaviour
    {
        private void Awake()
        {
            if (GetComponent<BaseInputModule>() != null)
                return;
#if ENABLE_INPUT_SYSTEM
            Type module = Type.GetType("UnityEngine.InputSystem.UI.InputSystemUIInputModule, Unity.InputSystem");
            if (module != null)
            {
                gameObject.AddComponent(module);
                return;
            }
#endif
            gameObject.AddComponent<StandaloneInputModule>();
        }
    }
}
