20 lines
413 B
C#
20 lines
413 B
C#
|
|
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;
|
||
|
|
}
|
||
|
|
}
|