public override void OnAppStart(ManagerSettingBase managerSetting) { m_name = typeof(UIManager).ToString(); if (string.IsNullOrEmpty(m_name)) { throw new System.Exception("manager name is empty"); } m_setting = managerSetting as ManagerSettingBase; if (null == m_setting) { throw new System.Exception("manager setting is null"); } CreateRootObject(m_setting.transform, "UIManager"); m_widgetRepositories = new UIRepositories(this); var uiRoot = RootObject.GetComponent <UIRoot>(); if (uiRoot == null) { uiRoot = RootObject.AddComponent <UIRoot>(); } uiRoot.scalingStyle = UIRoot.Scaling.ConstrainedOnMobiles; uiRoot.fitHeight = false; uiRoot.fitWidth = true; BhvOnEnter(); }
public void Init() { if (!IsInited) { _gameManager = RootObject.AddComponent <GameManager>(); UnityEngine.Object.DontDestroyOnLoad(RootObject); IsInited = true; } }