private static void SetButtonFocused(ToolbarButton button) { if (button == null) { return; } button.Button.normalBgSprite = button.Button.focusedBgSprite = button.Button.hoveredBgSprite = string.Concat(button.Button.normalBgSprite.Replace("Focused", ""), "Focused"); button.Button.normalFgSprite = button.Button.focusedFgSprite = button.Button.hoveredFgSprite = string.Concat(button.Button.normalFgSprite.Replace("Focused", ""), "Focused"); }
private void SetButtonUnfocused(ToolbarButton button) { if (button == null) { return; } button.Button.normalBgSprite = button.Button.focusedBgSprite = button.Button.normalBgSprite.Replace("Focused", ""); button.Button.hoveredBgSprite = button.Button.hoveredBgSprite.Replace("Focused", "Hovered"); button.Button.normalFgSprite = button.Button.focusedFgSprite = button.Button.normalFgSprite.Replace("Focused", ""); button.Button.hoveredFgSprite = button.Button.hoveredFgSprite.Replace("Focused", "Hovered"); }
private void OnButtonClicked(ToolbarButton button, ToolbarButton[] buttons) { UnfocusButtons(buttons); if (_currentPanel != null) { bool same = button.Category == _currentPanel.Category; Destroy(_currentPanel.gameObject); _currentPanel = null; if (same) { return; } } _currentPanel = CreatePanel(button.Category); SetButtonFocused(button); RefreshZOrder(); }
private void OnButtonClicked(ToolbarButton button) { EventButtonClicked?.Invoke(button, _buttons); }