示例#1
0
        public void GetCenter(ref Vector3 result)
        {
            result = Vector3.zero;
            int totalCount = 0;

            for (int i = 0; i < MeshObjectList.Count; i++)
            {
                NullMeshObject meshObject = MeshObjectList[i];
                meshObject.GetCenter(ref result);
                totalCount += meshObject.GetVertexCount();
            }
            if (totalCount == 0)
            {
                return;
            }
            result = result * (1.0f / totalCount);
        }