Exemplo n.º 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);
     }
 }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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
        }
Exemplo n.º 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.");
 }