0

我想要的是以下内容:

  • 我在场景中有一个物体(它永远不会移动)
  • 使用移动设备上的 onSwipe,相机应该围绕对象旋转
  • 用捏(两指放大或缩小)我想放大/缩小场景中的对象

所以我用cinemamachine试了一下,用鼠标让它工作。但是我能做些什么来使这项工作与移动输入一起工作。

这是我在 CineMachine 中的设置: 在此处输入图像描述

还有我的 CameraController.cs:

        if (Input.GetMouseButtonDown(0) || Input.touches.Any(x => x.phase == TouchPhase.Began))// kinda works, but its laggie
    {
        freeLookComponent.m_XAxis.m_MaxSpeed = 500;
    }
    if (Input.GetMouseButtonUp(0) || Input.touches.Any(x => x.phase == TouchPhase.Ended))// kinda works, but its laggie
    {
        freeLookComponent.m_XAxis.m_MaxSpeed = 0;
    }

    if (Input.mouseScrollDelta.y != 0) //and touch???
    {
        freeLookComponent.m_YAxis.m_MaxSpeed = 50;
    }
4

0 回答 0