Exemple #1
0
        /// <summary>
        /// Changes the current panel to the specified panel id.
        /// </summary>
        public void ChangeCurrentPanel(string panelId)
        {
            UiPanel panel;
            if (_uiPanelDataHolder.TryGetValue (panelId, out panel)) {
              {
                UiPanel prevPanel = _currentPanel;

                if (prevPanel != null) {
                    PanelExitContext context = new PanelExitContext();
                    // Debug.Log("Exit: " + prevPanel.name);
                    prevPanel.OnExit (context);
                }
              }

              {
                PanelEnterContext context = new PanelEnterContext();
                _currentPanel = panel;
                _currentPanelId = panelId;
                // Debug.Log("Enter: " + _currentPanel.name);
                _currentPanel.OnEnter (context);
              }
            } else {
                Debug.LogError ("Unable to activate a panel that is not registered: " + panelId);
            }
        }
Exemple #2
0
        /// <summary>
        /// Changes the current panel to the specified panel id.
        /// </summary>
        public void ChangeCurrentPanel(string panelId)
        {
            UiPanel panel;

            if (_uiPanelDataHolder.TryGetValue(panelId, out panel))
            {
                {
                    UiPanel prevPanel = _currentPanel;

                    if (prevPanel != null)
                    {
                        PanelExitContext context = new PanelExitContext();
                        // Debug.Log("Exit: " + prevPanel.name);
                        prevPanel.OnExit(context);
                    }
                }

                {
                    PanelEnterContext context = new PanelEnterContext();
                    _currentPanel   = panel;
                    _currentPanelId = panelId;
                    // Debug.Log("Enter: " + _currentPanel.name);
                    _currentPanel.OnEnter(context);
                }
            }
            else
            {
                Debug.LogError("Unable to activate a panel that is not registered: " + panelId);
            }
        }
Exemple #3
0
 /// <summary>
 /// Called when the panel is deactivated.
 /// </summary>
 public abstract void OnExit(PanelExitContext context);
Exemple #4
0
 /// <summary>
 /// Called when the panel is deactivated.
 /// </summary>
 public abstract void OnExit(PanelExitContext context);