I
Size: a a a
I
🎁
s
DS
s
I
public void Scale(Transform what, Camera cam, float relativeSize)я сделяль, но ниработаит :( собственно, нихрена не уменьшается.
{
var position = what.position;
var targetSize = Vector3.Distance(
cam.ViewportToWorldPoint(new Vector3(0f, 0f, position.z)),
cam.ViewportToWorldPoint(new Vector3(0f, relativeSize, position.z)));
var currentSize = what.GetComponent<Renderer>().bounds.size;
var currScale = what.transform.localScale;
currScale = new Vector3(
targetSize * currScale.x / currentSize.y,
targetSize * currScale.y / currentSize.y,
targetSize * currScale.z / currentSize.y
);
what.localScale = currScale;
}
YK
YK
YK
I
compositeRoot.gameObject.GetComponent<Renderer>().bounds.Encapsulate(newBounds);
HN
IK
AD
compositeRoot.gameObject.GetComponent<Renderer>().bounds.Encapsulate(newBounds);
FL
FL
KE
KE
FL
FL
KE