📜  如何在变量中获取游戏对象的全局位置 - C# 代码示例

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

代码示例1
// for unity users only!

// use transform instead of GetComponent

void Start()
{
  Vector3 LocalPosition = gameObject.GetComponent().position;
  Vector3 GloabalPosition = gameObject.transform.position;
}