Example #1
0
 void Update()
 {
     if (Input.GetKeyDown(key) || (!string.IsNullOrEmpty(buttonName) && InputDeviceManager.IsButtonDown(buttonName)))
     {
         ExecuteEvents.Execute(m_selectable.gameObject, new PointerEventData(EventSystem.current), ExecuteEvents.submitHandler);
     }
 }
 private void Update()
 {
     if (InputDeviceManager.IsButtonDown(menuInputButton))
     {
         ToggleMenu();
     }
 }
 private bool IsBeingClickedBySubmit()
 {
     return(EventSystem.current != null &&
            EventSystem.current.currentSelectedGameObject == m_selectable.gameObject &&
            InputDeviceManager.instance != null &&
            InputDeviceManager.IsButtonDown(InputDeviceManager.instance.submitButton));
 }
Example #4
0
 public void Awake()
 {
     if (m_instance == null)
     {
         m_instance = this;
     }
     GetButtonDown = DefaultGetButtonDown;
 }
 public static void SetDefaultJoystickAxesToCheck(InputDeviceManager inputDeviceManager)
 {
     if (inputDeviceManager == null)
     {
         return;
     }
     inputDeviceManager.joystickAxesToCheck = new string[] { "JoystickAxis1", "JoystickAxis2", "JoystickAxis3", "JoystickAxis4", "JoystickAxis6", "JoystickAxis7" };
     AddInputDefinitions(inputDeviceManager);
 }
 private void Update()
 {
     if (InputDeviceManager.IsKeyDown(key) ||
         (!string.IsNullOrEmpty(buttonName) && InputDeviceManager.IsButtonDown(buttonName)) ||
         (anyKeyOrButton && InputDeviceManager.IsAnyKeyDown()))
     {
         if (skipIfBeingClickedBySubmit && IsBeingClickedBySubmit())
         {
             return;
         }
         ExecuteEvents.Execute(m_selectable.gameObject, new PointerEventData(EventSystem.current), ExecuteEvents.submitHandler);
     }
 }
Example #7
0
 public void Awake()
 {
     if (m_instance != null && singleton)
     {
         Destroy(gameObject);
     }
     else
     {
         m_instance    = this;
         GetButtonDown = DefaultGetButtonDown;
         GetInputAxis  = DefaultGetAxis;
         if (singleton)
         {
             transform.SetParent(null);
             DontDestroyOnLoad(gameObject);
         }
     }
 }
Example #8
0
        public void Awake()
        {
            if (m_instance != null && singleton)
            {
                Destroy(gameObject);
            }
            else
            {
                m_instance    = this;
                GetButtonDown = DefaultGetButtonDown;
                GetInputAxis  = DefaultGetAxis;
                if (singleton)
                {
                    transform.SetParent(null);
                    DontDestroyOnLoad(gameObject);
                }
            }
#if !UNITY_5_3
            SceneManager.sceneLoaded += OnSceneLoaded;
#endif
        }
Example #9
0
 public static void AddInputDefinitions(InputDeviceManager inputDeviceManager)
 {
     if (inputDeviceManager == null)
     {
         return;
     }
     foreach (var button in inputDeviceManager.joystickButtonsToCheck)
     {
         AddInputDefinition(button);
     }
     foreach (var axis in inputDeviceManager.joystickAxesToCheck)
     {
         AddInputDefinition(axis);
     }
     foreach (var button in inputDeviceManager.keyButtonsToCheck)
     {
         AddInputDefinition(button);
     }
     foreach (var button in inputDeviceManager.backButtons)
     {
         AddInputDefinition(button);
     }
     Debug.Log("All input definitions are in Unity's Input Manager.");
 }