Project_WL/Assets/Script/Info/MainCamInfo.cs

20 lines
413 B
C#
Raw Normal View History

2024-12-15 01:39:39 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MainCamInfo : MonoBehaviour
{
Transform tf_target;
Vector3 offset;
public void Set(Transform _tf)
{
tf_target = _tf;
offset = transform.position - tf_target.transform.position;
}
void LateUpdate()
{
transform.position = tf_target.transform.position + offset;
}
}