12345678910111213141516171819202122232425 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class AnchorFollowCamera : MonoBehaviour
- {
- public Transform TargetCam;
- void Start()
- {
- if(TargetCam == null)
- {
- TargetCam = Camera.main.transform;
- }
- }
- void Update()
- {
- if(TargetCam != null)
- {
- transform.position = TargetCam.position;
- transform.rotation = TargetCam.rotation;
- }
- }
- }
|