Ejemplo n.º 1
0
    // 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;
                    }
                }
            }
        }
    }
Ejemplo n.º 2
0
    /// <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);
    }