示例#1
0
 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");
 }
示例#2
0
 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");
 }
示例#3
0
 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();
 }
示例#4
0
 private void OnButtonClicked(ToolbarButton button)
 {
     EventButtonClicked?.Invoke(button, _buttons);
 }