SP
Size: a a a
SP
AN
SP
AN
I
I
private Bounds CalculateLocalBounds()
{
var currentRotation = transform.rotation;
transform.rotation = Quaternion.Euler(Vector3.zero);
var bounds = new Bounds(transform.position, Vector3.zero);
foreach(var rend in GetComponentsInChildren<Renderer>())
{
bounds.Encapsulate(rend.bounds);
}
var localCenter = bounds.center - transform.position;
bounds.center = localCenter;
transform.rotation = currentRotation;
return bounds;
}
sb
sb
AN
sb
sb
sb
sb
AN
sb
AN
sb
sb
sb
sb