반응형
- UIroot.cs 코드 변경
public void UpdateScale(bool updateAnchors = true)
{
if (mTrans != null)
{
float calcActiveHeight = activeHeight;
if (calcActiveHeight > 0f)
{
float size = 2f / calcActiveHeight;
Vector3 ls = mTrans.localScale;
if (!(Mathf.Abs(ls.x - size) <= float.Epsilon) ||
!(Mathf.Abs(ls.y - size) <= float.Epsilon) ||
!(Mathf.Abs(ls.z - size) <= float.Epsilon))
{
//mTrans.localScale = new Vector3(size, size, size);
float x_value = (NGUITools.screenSize.x / Screen.width);
float temp_value = (Screen.height * x_value);
float y_value = NGUITools.screenSize.y / temp_value;
mTrans.localScale = new Vector3(size, size * y_value, size);
if (updateAnchors) BroadcastMessage("UpdateAnchors", SendMessageOptions.DontRequireReceiver);
}
}
}
}
반응형