UICamera单独拿来渲染UI层的东西,Camera 用作主Camera,且UICamera要渲染
的Depth only要比主Camera要大,这样UICamera层的东西就能展现在Main Camera前边
下边附上Camera跟随人物移动的脚本
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFollowPlayer : MonoBehaviour
{
private Vector3 offset;
public Transform role;
public float moveSpeed = 3;
public float rotateSpeed = 3;
// Start is called before the first frame update
void Start()
{
offset = transform.position - role.position;
offset