コード例 #1
0
    IEnumerator CoMoveDrag(Vector3 start)
    {
        float startRotation = center.localEulerAngles.y;
        float startPosition = LocalPosition.z;

        while (dragging)
        {
            Vector3 delta = Camera.ScreenToViewportPoint(Input.mousePosition - start);

            float vOffset = lpfVertical.InputSignal(delta.x);
            center.SetLocalEulerAnglesY(startRotation + vOffset * 90);

            float hOffset = lpfHorizontal.InputSignal(delta.y);
            transform.SetLocalPositionZ(startPosition - hOffset * 50f);

            yield return(null);
        }
    }