コード例 #1
0
ファイル: MobileMovementJoystick.cs プロジェクト: 517752548/-
    public void OnPointerUp(PointerEventData data)
    {
        if (!isDragging)
        {
            return;
        }
        if (data.pointerId != touchId)
        {
            return;
        }

        isDragging = false;
        touchId    = -1;
        movementController.position = defaultControllerPosition;
        if (movementBackground != null)
        {
            movementBackground.position = backgroundOffset + movementController.position;
        }

        if (useAxisX)
        {
            RPGInputManager.SetAxis(axisXName, 0);
        }

        if (useAxisY)
        {
            RPGInputManager.SetAxis(axisYName, 0);
        }
    }
コード例 #2
0
ファイル: MobileSwipeArea.cs プロジェクト: 517752548/-
    public void UpdateVirtualAxes(Vector3 value)
    {
        value = value.normalized;

        if (useAxisX)
        {
            RPGInputManager.SetAxis(axisXName, value.x);
        }

        if (useAxisY)
        {
            RPGInputManager.SetAxis(axisYName, value.y);
        }
    }
コード例 #3
0
ファイル: MobileMovementJoystick.cs プロジェクト: 517752548/-
    private void UpdateVirtualAxes(Vector3 value)
    {
        var delta = startDragPosition - value;

        delta.y = -delta.y;
        delta  /= movementRange;
        if (useAxisX)
        {
            RPGInputManager.SetAxis(axisXName, -delta.x);
        }

        if (useAxisY)
        {
            RPGInputManager.SetAxis(axisYName, delta.y);
        }
    }