相机位置,只需旋转

时间:2019-05-14 22:43:22

标签: unity3d

ImageCamera

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MainGame : MonoBehaviour
{
    public float speed;

    // Start is called before the first frame update
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Moved)
        {
            Vector2 touchDeltaPosition = Input.GetTouch(0).deltaPosition;
            transform.Translate(-touchDeltaPosition.x * speed, -touchDeltaPosition.y * speed, 0);
        }
    }
}

我制作了3D游戏,我希望我的相机保持在固定位置并旋转,这是我使用的脚本。我需要添加什么才能固定相机并旋转?

0 个答案:

没有答案