void Update() { bool usingGamepad = InputWrapper.AnyJoysticksConnected(); mGamepadPrompt.SetActive(usingGamepad); mKeyboardMousePrompt.SetActive(!usingGamepad); }
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; }
void Start() { if (Instance == null) { Instance = this; DontDestroyOnLoad(this); } else { Destroy(gameObject); } }
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)); } } }
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; }