コード例 #1
0
ファイル: UiPanelMgr.cs プロジェクト: spotco/ld-33
        /// <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);
            }
        }
コード例 #2
0
ファイル: UiPanelMgr.cs プロジェクト: doggan/ld-33
        /// <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);
            }
        }
コード例 #3
0
ファイル: UiPanel.cs プロジェクト: spotco/ld-33
 /// <summary>
 /// Called when the panel is deactivated.
 /// </summary>
 public abstract void OnExit(PanelExitContext context);
コード例 #4
0
ファイル: UiPanel.cs プロジェクト: doggan/ld-33
 /// <summary>
 /// Called when the panel is deactivated.
 /// </summary>
 public abstract void OnExit(PanelExitContext context);