📜  如何使游戏对象在特定向量中传播 - TypeScript 代码示例

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

代码示例1
float radius = 1f;
 for (int i = 0; i < 8; i++)
 {
     float angle = i * Mathf.PI*2f / 8;
     Vector3 newPos = new Vector3(Mathf.Cos(angle)*radius, y, Mathf.Sin(angle)*radius);
     GameObject go = Instantiate(GameObject.CreatePrimitive(PrimitiveType.Cube), newPos, Quaternion.identity);
 }