void Update()
        {
            bool usingGamepad = InputWrapper.AnyJoysticksConnected();

            mGamepadPrompt.SetActive(usingGamepad);
            mKeyboardMousePrompt.SetActive(!usingGamepad);
        }
Exemple #2
0
        public void Update()
        {
            bool anyJoysticksConnected = InputWrapper.AnyJoysticksConnected();

            if (anyJoysticksConnected)
            {
                mInputModule.verticalAxis = InputWrapper.LeftYJoystickInputName;
                mInputModule.submitButton = InputWrapper.Xbox360SubmitAxis;
            }
            else
            {
                mInputModule.verticalAxis = InputWrapper.LeftYInputName;
                mInputModule.submitButton = InputWrapper.SubmitAxis;
            }

            if (!anyJoysticksConnected && (joystickWasConnected || mFirstFrame))
            {
                mUIEventSystem.SetSelectedGameObject(null);
                joystickWasConnected = false;
            }
            else if (anyJoysticksConnected && !joystickWasConnected)
            {
                mUIEventSystem.SetSelectedGameObject(mUIEventSystem.firstSelectedGameObject);
                joystickWasConnected = true;
            }
            mFirstFrame = false;
        }
Exemple #3
0
 void Start()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Exemple #4
0
        void Update()
        {
            bool usingController = InputWrapper.AnyJoysticksConnected();

            if (UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject == mSessionNameField.gameObject)
            {
                if (InputWrapper.Instance.SubmitPressed)
                {
                    OnHostGameNameEntered();
                }
                else if (usingController && InputWrapper.Instance.LeftYInput < -Mathf.Epsilon)
                {
                    var currentEvtSys = UnityEngine.EventSystems.EventSystem.current;
                    currentEvtSys.SetSelectedGameObject(mSessionLaunchButton);
                    StartCoroutine(TemporarilyDisableDownInput(currentEvtSys));
                }
            }
        }
Exemple #5
0
        public void Start()
        {
            mFirstFrame    = true;
            mUIEventSystem = GetComponent <UnityEngine.EventSystems.EventSystem>();

            if (InputWrapper.AnyJoysticksConnected())
            {
                joystickWasConnected = true;
                mUIEventSystem.SetSelectedGameObject(mUIEventSystem.firstSelectedGameObject);
            }
            else
            {
                joystickWasConnected = false;
                mUIEventSystem.SetSelectedGameObject(null);
            }

            mInputModule = GetComponent <UnityEngine.EventSystems.StandaloneInputModule>();
            mInputModule.horizontalAxis = InputWrapper.LeftXInputName;
            mInputModule.verticalAxis   = InputWrapper.LeftYInputName;
        }