/// <summary> /// 在三维空间的圆环上均匀布点 /// </summary> /// <param name="posArray">最终计算出的点位置</param> /// <param name="centerPos">中心点</param> /// <param name="count">分布的点数量</param> /// <param name="radius">半径</param> void InitPosFromCircularRing(out Vector3[] posArray, Vector3 centerPos, int count, float radius) { posArray = new Vector3[count]; float copies = (360.0f / count) * Mathf.Deg2Rad; for (int i = 0, j = count; i < j; ++i) { float x = radius * Mathf.Cos(copies * i); //float y = centerPos.y; float z = radius * Mathf.Sin(copies * i); Vector3 vec3 = new Vector3(x, 0, z) + centerPos; posArray[i] = vec3; } }