protected IEnumerator LoadPanelAsync(UIPanelSettings settings) { Log("LoadPanelAsync " + settings.PanelType); m_loadingPanels.Add(settings.PanelType); var assetKey = GetPathByAttribute(settings.PanelType); var container = m_layers[settings.Layer]; Assert.IsNotNull(container, $"Can't get layer {settings.Layer}"); UIPanel panel = null; m_content.InstantiateComponentAsync <UIPanel>(assetKey, (result) => { Assert.IsTrue(result.status == RequestStatus.SUCCESS, $"panel {GetType()} load failure!!!"); panel = result.result as UIPanel; Assert.IsTrue(panel != null, $"panel {GetType()} load failure!!!"); }, container); yield return(new WaitUntil(() => panel != null)); Assert.IsNotNull(panel, $"LoadPanelAsync failed for {settings.PanelType}: key={assetKey}"); InstantiatePanel(panel, settings); m_loadingPanels.Remove(settings.PanelType); Log("End LoadPanelAsync " + settings.PanelType); }
protected void InstantiatePanel(UIPanel panel, UIPanelSettings settings) { Log("InstantiatePanel " + settings.PanelType); m_panels.Add(settings.PanelType, panel); panel.ChangePanelEvent += OnChangePanelHandler; panel.HidePanelEvent += OnHidePanelHandler; panel.ShowPanelEvent += OnShowPanelHandler; panel.UpdatePanelEvent += OnUpdatePanelHandler; panel.ShowAsSubpanelEvent += OnShowAsSubpanelHandler; panel.PanelDataChangedEvent += OnPanelDataChangedHandler; panel.Initialize(UiDataProvider, settings); panel.gameObject.SetActive(false); }
public override void Initialize(UIDataProvider uiDataProvider, UIPanelSettings settings) { base.Initialize(uiDataProvider, settings); }
public override void Initialize(UIDataProvider uiDataProvider, UIPanelSettings settings) { base.Initialize(uiDataProvider, settings); m_textHelp = new TextHelp(); }
public override void Initialize(UIDataProvider uiDataProvider, UIPanelSettings settings) { base.Initialize(uiDataProvider, settings); m_optionItems = new List <OptionItem>(); }