Exemple #1
0
    //-------------------------------------------------------------------
    void Update()
    {
        if (GamepadID < 0)
        {
            return;
        }

        X      = Input.GetAxis("Horizontal" + GamepadID);
        Y      = Input.GetAxis("Vertical" + GamepadID);
        Action = Input.GetKeyDown(GetActionKey(GamepadID));

        VirtualController.SetMovement(new Vector2(X, Y).normalized);
        if (Action)
        {
            VirtualController.DoAction();

            if (GameManager.GetInstance().m_currentState == eGameState.WAIT_FOR_READY)
            {
                // toggle ready
                if (Action)
                {
                    VirtualController.SetReady(!VirtualController.ClientIsReady);
                }
            }
        }
    }
    //-------------------------------------------------------------------
    public void ToggleReady()
    {
        if (CurrentState != eClientState.LOBBY)
        {
            return;
        }

        Controller.SetReady(!Controller.ClientIsReady);
    }