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

            mGamepadPrompt.SetActive(usingGamepad);
            mKeyboardMousePrompt.SetActive(!usingGamepad);
        }
예제 #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;
        }
예제 #3
0
 void Start()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         Destroy(gameObject);
     }
 }
예제 #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));
                }
            }
        }
예제 #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;
        }