Skip to content
Snippets Groups Projects
EventsystemMode_Ctrl.cs 1.69 KiB
Newer Older
  • Learn to ignore specific revisions
  • using UnityEngine;
    using UnityEngine.EventSystems;
    using UnityEngine.InputSystem.UI;
    
    MaZiFAU's avatar
    MaZiFAU committed
    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;
    
    
    MaZiFAU's avatar
    MaZiFAU committed
        private int GpMode_before = -99;
    
    MaZiFAU's avatar
    MaZiFAU committed
            Update2();
    
    Stefan Richter's avatar
    Stefan Richter committed
            /* 
            Update3();
            */
        }
    
    Stefan Richter's avatar
    Stefan Richter committed
        private void Update3()
        {
    
    MaZiFAU's avatar
    MaZiFAU committed
            Update2();
    
    
    Stefan Richter's avatar
    Stefan Richter committed
            if (GpMode_before != UIconfig.InputManagerVersion)
    
    Stefan Richter's avatar
    Stefan Richter committed
    
    
    MaZiFAU's avatar
    MaZiFAU committed
            //if (GpMode_before != UIconfig.EventSystemModule)
    
    Stefan Richter's avatar
    Stefan Richter committed
    
    
    MaZiFAU's avatar
    MaZiFAU committed
        private void Update2()
        {
    
            //Todo Eventbased
            switch (UIconfig.EventSystemModule)
            {
                case 0:
                    break;
    
    
    MaZiFAU's avatar
    MaZiFAU committed
                case 1:
    
                    //StandaloneInputModule_script.ActivateModule();
                    //InputSystem_script.DeactivateModule();
    
    
    MaZiFAU's avatar
    MaZiFAU committed
                    gameObject.GetComponent<StandaloneInputModule>().enabled = true;
    
                    gameObject.GetComponent<InputSystemUIInputModule>().enabled = false;
                    break;
    
    MaZiFAU's avatar
    MaZiFAU committed
                //InputSystem_script.ActivateModule();
                //StandaloneInputModule_script.DeactivateModule();
    
                case 3:
                default:
                    gameObject.GetComponent<StandaloneInputModule>().enabled = false;
                    gameObject.GetComponent<InputSystemUIInputModule>().enabled = true;
                    break;
            }
    
    
    MaZiFAU's avatar
    MaZiFAU committed
            GpMode_before = UIconfig.GameplayMode;