一.第三人称视角 _1 先设置好相机与玩家之间的角度 给相机添加代码 using UnityEngine; using System.Collections; namespace CompleteProject { public class CameraFollow : MonoBehaviour { public Transform target; // The position that that camera will be following. public float smoothin…
最近在写关于相机跟随的逻辑,其实最早接触相机跟随是在Unity官网的一个叫Roll-a-ball tutorial上,其中简单的涉及了关于相机如何跟随物体的移动而移动,如下代码: using UnityEngine; using System.Collections; public class CameraController : MonoBehaviour { public GameObject player; private Vector3 offset; void Start () { o…
固定相机跟随 这种相机有一个参考对象,它会保持与该参考对象固定的位置,跟随改参考对象发生移动 using UnityEngine; using System.Collections; public class CameraFlow : MonoBehaviour { public Transform target; private Vector3 offset; // Use this for initialization void Start() { offset = target.posit…
固定相机跟随 这种相机有一个参考对象,它会保持与该参考对象固定的位置,跟随改参考对象发生移动 using UnityEngine; using System.Collections; public class CameraFlow : MonoBehaviour { public Transform target; private Vector3 offset; // Use this for initialization void Start() { offset = target.posit…