Esempio n. 1
0
        public static void Init()
        {
            if (InputSystem.TKeyboard != null || (ReflectionHelpers.LoadModule("Unity.InputSystem") && InputSystem.TKeyboard != null))
            {
                m_inputModule = new InputSystem();
            }
            else if (LegacyInput.TInput != null || (ReflectionHelpers.LoadModule("UnityEngine.InputLegacyModule") && LegacyInput.TInput != null))
            {
                m_inputModule = new LegacyInput();
            }

            if (m_inputModule == null)
            {
                ExplorerCore.LogWarning("Could not find any Input module!");
                m_inputModule = new NoInput();
            }

            m_inputModule.Init();
        }
Esempio n. 2
0
        public static void Init()
        {
            if (InputSystem.TKeyboard != null || TryLoadModule("Unity.InputSystem", InputSystem.TKeyboard))
            {
                inputModule = new InputSystem();
            }
            else if (LegacyInput.TInput != null || TryLoadModule("UnityEngine.InputLegacyModule", LegacyInput.TInput))
            {
                inputModule = new LegacyInput();
            }

            if (inputModule == null)
            {
                ExplorerCore.LogWarning("Could not find any Input module!");
                inputModule = new NoInput();
            }

            inputModule.Init();

            bool TryLoadModule(string dll, Type check) => ReflectionHelpers.LoadModule(dll) && check != null;
        }