Do not use the variadic max to avoid gc

public static float Max(params float[] values);
This commit is contained in:
ousttrue
2021-04-12 16:26:49 +09:00
parent b13ed68c07
commit 4893c4b90e
2 changed files with 3 additions and 3 deletions

View File

@@ -267,7 +267,7 @@ namespace VRM
{
Position = transform.TransformPoint(collider.Offset);
var ls = transform.lossyScale;
var scale = Mathf.Max(ls.x, ls.y, ls.z);
var scale = Mathf.Max(Mathf.Max(ls.x, ls.y), ls.z);
Radius = scale * collider.Radius;
}
}

View File

@@ -36,8 +36,8 @@ namespace VRM
get
{
return Mathf.Max(
transform.lossyScale.x,
transform.lossyScale.y,
Mathf.Max(transform.lossyScale.x,
transform.lossyScale.y),
transform.lossyScale.z
);
}