using UnityEngine; public class ScreenSizeChangeNotifier : MonoBehaviour { int lastWidth; int lastHeight; void Start() { lastWidth = Screen.width; lastHeight = Screen.height; } void Update() { if ((lastWidth != Screen.width) || (lastHeight != Screen.height)) { lastWidth = Screen.width; lastHeight = Screen.height; BroadcastMessage("OnScreenSizeChanged", SendMessageOptions.DontRequireReceiver); } } }