using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem.UI;
using static UIconfig;

public class EventsystemMode_Ctrl : MonoBehaviour
{
    //public GameObject myself_GObj;
    //public GameObject StandaloneInputModule_GObj;
    //public GameObject InputSystem_GObj;
    public StandaloneInputModule StandaloneInputModule_script;
    public InputSystemUIInputModule InputSystem_script;

    private int GpMode_before = -99;


    void Start()
    {
        Update2();
    }

    private void Update()
    {
        /* 
        Update3();
        */
    }

    private void Update3()
    {
        Update2();

        if (GpMode_before != UIconfig.InputManagerVersion)
            EventSystemModule = InputManagerVersion;

        //if (GpMode_before != UIconfig.EventSystemModule)
    }


    private void Update2()
    {
        //Todo Eventbased
        switch (UIconfig.EventSystemModule)
        {
            case 0:
                break;

            case 1:
                //StandaloneInputModule_script.ActivateModule();
                //InputSystem_script.DeactivateModule();

                gameObject.GetComponent<StandaloneInputModule>().enabled = true;
                gameObject.GetComponent<InputSystemUIInputModule>().enabled = false;
                break;

            case 2:
            //InputSystem_script.ActivateModule();
            //StandaloneInputModule_script.DeactivateModule();
            case 3:
            default:
                gameObject.GetComponent<StandaloneInputModule>().enabled = false;
                gameObject.GetComponent<InputSystemUIInputModule>().enabled = true;
                break;
        }

        GpMode_before = UIconfig.GameplayMode;
    }
}