以下为NGUI源码
UICamera.csvoid LateUpdate ()
{
#if UNITY_EDITOR
if (!Application.isPlaying || !handlesEvents) return;
#else
if (!handlesEvents) return;
#endif
int w = Screen.width;
int h = Screen.height;
if (w != mWidth || h != mHeight)
{
mWidth = w;
mHeight = h;
UIRoot.Broadcast("UpdateAnchors");
if (onScreenResize != null)
onScreenResize();
}
}