private void BackCommand() { if (_activePanelView.ParentPanel == null) { return; //Already at root; } _activePanelView.ClearSelection(); _activePanelView.SetPanelVisibility(false); _activePanelView = _activePanelView.ParentPanel; _activePanelView.SelectNext(); }
private CommandPanelView CreatePanel(CommandPanelView parentPanel = null) { CommandPanelView panelView = _commandPanelFactory.Create(); panelView.transform.SetParent(_view.CommandPlatesTransform, false); panelView.SetPanelVisibility(false); if (parentPanel != null) { panelView.ParentPanel = parentPanel; } return(panelView); }
public void Activate() { if (_activePanelView != null) { _activePanelView.SetPanelVisibility(false); } _activePanelView = _characterManager.ActiveCharacter.CommandPanelView; _activePanelView.SetPanelVisibility(true); _inputManager.OnRight += SelectCommand; _inputManager.OnEnter += SelectCommand; _inputManager.OnLeft += BackCommand; _inputManager.OnBack += BackCommand; _inputManager.OnDown += NextCommand; _inputManager.OnUp += PreviousCommand; }
private void SelectCommand() { if (_activePanelView.GetActiveAction() == null) { throw new WarningException("Select command was hit before an item has been selected."); } if (_activePanelView.GetActiveAction().ChildPanel == null) { Deactivate(); _statusesViewController.Activate(_activePanelView.GetActiveAction().Action); return; } _activePanelView = _activePanelView.GetActiveAction().ChildPanel; _activePanelView.SetPanelVisibility(true); _activePanelView.ParentPanel.ClearSelection(); if (_activePanelView.GetActiveAction() == null) { _activePanelView.SelectNext(); //Make sure we select the first item if nothing has been selected yet. } }