📜  如何使 ui 跟随游戏对象 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:13.704000             🧑  作者: Mango

代码示例1
public Transform target;
 
void Update ()
{
     Vector3 wantedPos = Camera.main.WorldToScreenPoint(target.position);
     transform.position = wantedPos;
}