创建标签系统包

This commit is contained in:
MuHua-123
2025-02-27 17:40:31 +08:00
parent 27aed5f684
commit cf0e273205
125 changed files with 13817 additions and 62 deletions
@@ -0,0 +1,21 @@
using UnityEngine;
namespace MuHua
{
public class LabelFollower : MonoBehaviour
{
public Transform target; // 要跟随的目标物体
public Vector3 offset; // 标签的偏移量
void Update()
{
if (target != null)
{
// 设置标签的位置
transform.position = target.position + offset;
// 使标签面向相机
transform.rotation = Camera.main.transform.rotation;
}
}
}
}