Esempio n. 1
0
    protected override void StickMove(StickControl control)
    {
        base.StickMove(control);

        if (control.name == "leftStick")
        {
            m_leftStickText.text = control.ReadValue().ToString("F2");
        }
        else if (control.name == "rightStick")
        {
            m_rightStickText.text = control.ReadValue().ToString("F2");
        }
    }
    // Callback function when a stick is moved.
    protected virtual void StickMove(StickControl control)
    {
        Transform stick = GetInputTransform(FirstLetterToUpper(control.name), isStick: true);
        Vector2   pos   = control.ReadValue() * 0.5f;

        stick.localPosition = new Vector3(pos.x, pos.y, -0.01f);
    }
Esempio n. 3
0
    // Callback function when a stick is moved.
    protected virtual void StickMove(StickControl control)
    {
        Vector2   pos   = control.ReadValue();
        Transform stick = GetInputTransform(FirstLetterToUpper(control.name), isStick: true);

        if (stick != null)
        {
            stick.localPosition = new Vector3(pos.x * m_stickMaxMove, pos.y * m_stickMaxMove, stick.localPosition.z);
        }
    }
    protected override void StickMove(StickControl control)
    {
        base.StickMove(control);

        Transform stick    = GetInputTransform(FirstLetterToUpper(control.name), isStick: true);
        TextMesh  textMesh = stick.Find("Value_Input_System").GetComponent <TextMesh>();

        if (textMesh != null)
        {
            textMesh.text = control.ReadValue().ToString();
        }
    }
    protected override void StickMove(StickControl control)
    {
        Transform stick = GetInputTransform(FirstLetterToUpper(control.name), isStick: true);
        Vector2   pos   = control.ReadValue();

        if (stick != null)
        {
            stick.localPosition = new Vector3(pos.x * m_stickMaxMove, pos.y * m_stickMaxMove, stick.localPosition.z);
        }

        // update the text
        Transform positionText = stick.parent.Find("Pos");

        if (positionText != null)
        {
            positionText.GetComponent <TextMesh>().text = pos.ToString("F2");
        }
    }