// Update is called once per frame void Update() { if (m_BindAssignStarted) { if (m_NextTypeToAssign == InputType.Controller) { ControllerInput input = ControllerInputManager.GetAnyButtonPress(); if (input != ControllerInput.None) { if (IsControllerInputInUse(input)) { // Bind failed BindFailedEvent.Invoke(m_NextActionToAssign, InputType.Controller); m_BindAssignStarted = false; } else { // Bind succeeded m_InputBinds[m_NextActionToAssign].ControllerBind.ControllerInput = input; ControllerBindEvent.Invoke(m_NextActionToAssign, input); m_BindAssignStarted = false; } } } } }
/// <summary> /// Returns true if anything (keyboard or controller) is pressed. /// </summary> public bool IsAnythingPressed() { ControllerInput input = ControllerInputManager.GetAnyButtonPress(); if (input != ControllerInput.None) { return(true); } return(Input.anyKeyDown); }