public override void OnInit() { base.OnInit(); AddPropChangedNotify((int)MVCPropertyID.enBattlePropsManager, OnPropertyChanged); mEventScript = WindowRoot.GetComponent("UIControlRealTimeEvent") as UIControlRealTimeEvent; UIRoot root = GameObject.FindObjectOfType <UIRoot>(); if (null != root) { float s = (float)root.activeHeight / Screen.height; int height = Mathf.CeilToInt(Screen.height * s); int width = Mathf.CeilToInt(Screen.width * s); UIWidget widget = WindowRoot.GetComponent <UIWidget>(); UISprite sprite = widget as UISprite; sprite.width = width; sprite.height = height; } }
public override void OnInit() { base.OnInit(); AddPropChangedNotify((int)MVCPropertyID.enSceneManager, OnPropertyChanged); mEventScript = WindowRoot.GetComponent("UIControlRealTimeEvent") as UIControlRealTimeEvent; }