📜  查找变换中心、点、多个对象 - C# 代码示例

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

代码示例1
public Vector3 FindCenterOfTransforms(List transforms)
{
    var bound = new Bounds(transforms[0].position, Vector3.zero);
    for(int i = 1; i < transforms.length; i++)
    {
        bound.Encapsulate(transforms[i].position);
    }
    return bound.center;
}