鸟语天空
监听屏幕大小改变
post by:追风剑情 2016-11-10 21:02

以下为NGUI源码

UICamera.cs
void 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();
		}
}

 

评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容