Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UIButton.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using DG.Tweening;
4using Newtonsoft.Json;
5using UnityEngine;
6using UnityEngine.EventSystems;
7using UnityEngine.UI;
8
9public class UIButton : Button, IUISkin, IPointerDownHandler, IEventSystemHandler
10{
11 [JsonObject(MemberSerialization.OptIn)]
12 public class Item
13 {
14 [JsonProperty]
15 public bool always;
16
17 public virtual string TextTip => Name;
18
19 public virtual string Name => null;
20
21 public virtual Sprite SpriteHighlight => null;
22
23 public virtual string pathSprite => "";
24
25 public virtual bool IsSelectable => false;
26
27 public virtual bool AdjustImageSize => true;
28
29 public virtual bool UseIconForHighlight => false;
30
31 public virtual bool KeepVisibleWhenHighlighted => false;
32
33 public virtual Color SpriteColor => Color.white;
34
35 public virtual Vector3 SpriteScale => Vector3.one;
36
37 public virtual bool Hidden => false;
38
39 public virtual Transition Transition => Transition.SpriteSwap;
40
41 public virtual Sprite GetSprite()
42 {
44 }
45
46 public virtual Sprite GetSprite(bool highlight)
47 {
48 return null;
49 }
50
51 public virtual bool ShouldHighlight()
52 {
53 return false;
54 }
55
56 public virtual void OnAddedToBar()
57 {
58 }
59
60 public virtual void OnShowContextMenu(UIContextMenu m)
61 {
62 }
63
64 public virtual void OnHover(UIButton b)
65 {
66 }
67
68 public virtual void OnClick(UIButton b)
69 {
70 }
71
72 public virtual void OnSetItem(UIButton b)
73 {
74 }
75
76 public virtual void SetSubText(UIText t)
77 {
78 t.SetActive(enable: false);
79 }
80 }
81
82 public static bool DoSlide;
83
84 public static bool locked;
85
86 public static UIButton lastButton;
87
88 public static UIButton lastHovered;
89
91
93
94 public static float lastClicked;
95
96 public static float doubleClickTime = 0.4f;
97
98 public static Vector2 buttonPos;
99
100 public static Action onPressed;
101
103
105
107
109
110 public Image icon;
111
112 public Image imageCheck;
113
114 public Graphic[] targetGraphics;
115
116 public float scaleIcon = 1f;
117
118 public float slideX;
119
120 public float navigationFix;
121
122 public bool isChecked;
123
124 public bool instantClick = true;
125
127
129
130 public SoundData soundClick;
131
132 public SoundData soundHighlight;
133
134 public Transform animeTarget;
135
137
139
141
143
144 public Action onDoubleClick;
145
146 public Action onRightClick;
147
148 public Action<int> onInputWheel;
149
150 [NonSerialized]
151 public object refObj;
152
153 [NonSerialized]
154 public int refInt;
155
156 [NonSerialized]
157 public string refStr;
158
159 [NonSerialized]
160 public bool animating;
161
162 [NonSerialized]
163 public bool selected;
164
165 [NonSerialized]
166 public Vector3 originalIconScale = Vector3.one;
167
168 [NonSerialized]
170
171 [NonSerialized]
172 public Item item;
173
174 private List<Graphic> m_graphics;
175
176 private Tween tween;
177
178 private SelectionState lastState;
179
180 private static bool waiting;
181
182 public static List<UIButton> buttons = new List<UIButton>();
183
184 public static Action actionTooltip;
185
186 protected List<Graphic> Graphics
187 {
188 get
189 {
190 if (m_graphics == null)
191 {
192 m_graphics = new List<Graphic>();
193 if (base.targetGraphic != null)
194 {
195 m_graphics.Add(base.targetGraphic);
196 }
197 if (targetGraphics != null)
198 {
199 Graphic[] array = targetGraphics;
200 foreach (Graphic graphic in array)
201 {
202 m_graphics.Add(graphic);
203 }
204 }
205 }
206 return m_graphics;
207 }
208 }
209
210 public virtual bool CanDragLeftButton => true;
211
212 public virtual bool CanMiddleClick()
213 {
214 return false;
215 }
216
217 public virtual void OnMiddleClick(bool forceClick)
218 {
219 }
220
221 protected override void Awake()
222 {
223 if ((bool)icon)
224 {
225 originalIconScale = icon.transform.localScale;
226 }
227 if (Application.isPlaying)
228 {
229 ApplySkin();
230 }
231 base.Awake();
232 }
233
234 protected override void OnEnable()
235 {
236 selected = false;
237 base.OnEnable();
238 if (!EventSystem.current)
239 {
240 return;
241 }
242 if ((bool)imageCheck)
243 {
244 imageCheck.gameObject.SetActive(isChecked);
245 }
246 if (EventSystem.current.currentSelectedGameObject == base.gameObject)
247 {
248 if (base.transition == Transition.SpriteSwap && base.spriteState.highlightedSprite != base.image.sprite)
249 {
251 }
252 if ((bool)icon)
253 {
254 icon.transform.localScale = new Vector3(scaleIcon, scaleIcon, 1f);
255 }
256 }
257 }
258
259 public void SetItem(Item i)
260 {
261 item = i;
262 RefreshItem();
263 if (item != null)
264 {
265 item.OnSetItem(this);
266 }
267 }
268
269 public virtual void RefreshItem()
270 {
271 bool flag = item != null;
272 base.onClick.RemoveAllListeners();
273 icon.enabled = flag;
274 base.interactable = flag;
275 if (flag && item.Hidden)
276 {
277 icon.enabled = false;
278 base.interactable = false;
279 }
280 base.transition = item?.Transition ?? Transition.SpriteSwap;
281 if (flag)
282 {
283 icon.sprite = item.GetSprite();
284 base.onClick.AddListener(delegate
285 {
286 buttonPos = base.transform.position;
287 item.OnClick(this);
288 EInput.Consume(0);
289 });
290 icon.transform.localScale = item.SpriteScale;
292 {
293 icon.SetNativeSize();
294 }
295 else
296 {
297 icon.Rect().sizeDelta = new Vector2(48f, 48f);
298 }
299 tooltip.enable = !item.TextTip.IsEmpty();
300 tooltip.onShowTooltip = delegate(UITooltip t)
301 {
302 string textTip = item.TextTip;
303 t.textMain.text = textTip;
304 };
305 if ((bool)subText)
306 {
308 }
309 }
310 }
311
312 public virtual void OnHover()
313 {
314 if ((!(UIContextMenu.timeSinceClosed < 0.1f) || !(lastHovered == this)) && item != null && !Input.GetMouseButton(0) && !Input.GetMouseButton(1))
315 {
316 buttonPos = base.transform.position;
317 item.OnHover(this);
318 lastHovered = this;
319 }
320 }
321
322 public void Toggle()
323 {
324 group.Select(this, !isChecked);
325 }
326
327 public void ToggleCheck()
328 {
330 }
331
332 public void SetCheck(bool check)
333 {
334 isChecked = check;
335 if ((bool)imageCheck)
336 {
337 imageCheck.gameObject.SetActive(isChecked);
338 }
339 }
340
341 public void SetToggle(bool isOn, Action<bool> onToggle = null)
342 {
343 SetCheck(isOn);
344 base.onClick.RemoveAllListeners();
345 base.onClick.AddListener(delegate
346 {
348 if (onToggle != null)
349 {
350 onToggle(isChecked);
351 }
352 });
353 }
354
355 public void SetToggleWithScore(bool isOn, Action<bool> onToggle, int? score)
356 {
357 SetToggle(isOn, onToggle);
358 subText.SetActive(enable: false);
359 }
360
361 public void SetTooltip(Action<UITooltip> onShowTooltip = null, bool enable = true)
362 {
363 SetTooltip("note", onShowTooltip, enable);
364 }
365
366 public void SetTooltip(string id, Action<UITooltip> onShowTooltip = null, bool enable = true)
367 {
368 tooltip.id = id;
369 tooltip.enable = enable;
370 tooltip.onShowTooltip = onShowTooltip;
371 }
372
373 public void SetTooltipLang(string lang = null)
374 {
375 tooltip.enable = true;
376 tooltip.lang = lang;
377 }
378
379 public virtual void ShowTooltip()
380 {
381 if (tooltip.enable && !Input.GetMouseButton(0) && !waiting && !Input.GetMouseButton(1) && (!EInput.isShiftDown || !Input.GetMouseButton(0)))
382 {
384 }
385 }
386
387 public void ShowTooltipForced(bool ignoreWhenRightClick = true)
388 {
389 if (tooltip.enable && (!ignoreWhenRightClick || !Input.GetMouseButton(1)) && (!EInput.isShiftDown || !Input.GetMouseButton(0)))
390 {
392 }
393 }
394
395 public override void OnPointerDown(PointerEventData eventData)
396 {
398 if (!instantClick)
399 {
400 base.OnPointerDown(eventData);
401 }
402 else
403 {
404 if (EInput.IsConsumed)
405 {
406 return;
407 }
408 if (eventData.button != 0)
409 {
410 if (eventData.button == PointerEventData.InputButton.Right && onRightClick != null && !EInput.rightMouse.wasConsumed)
411 {
413 {
414 onRightClick();
415 });
416 }
417 return;
418 }
419 waiting = true;
421 {
423 {
424 waiting = false;
425 });
426 if (EInput.skipFrame <= 0)
427 {
428 if ((bool)animeClick)
429 {
430 EventSystem.current.enabled = false;
431 animeClick.Play(animeTarget ? animeTarget : base.transform).OnComplete(delegate
432 {
433 OnPress();
434 EventSystem.current.enabled = true;
435 });
436 }
437 else
438 {
439 _OnPress();
440 }
441 }
442 });
443 }
444 }
445
446 public override void OnPointerClick(PointerEventData eventData)
447 {
449 onPressed = null;
450 if (eventData.dragging || instantClick)
451 {
452 return;
453 }
454 waiting = true;
456 {
458 {
459 waiting = false;
460 });
461 if (EInput.skipFrame <= 0)
462 {
463 if (eventData.button != 0)
464 {
465 if (eventData.button == PointerEventData.InputButton.Right && onRightClick != null && !EInput.rightMouse.wasConsumed)
466 {
467 onRightClick();
468 }
469 }
470 else
471 {
472 _OnPress();
473 }
474 }
475 });
476 }
477
478 public override void OnPointerUp(PointerEventData eventData)
479 {
480 currentPressedButton = null;
481 onPressed = null;
482 if (!instantClick)
483 {
484 base.OnPointerUp(eventData);
485 }
486 }
487
488 public void OnPointerUpOnDrag(PointerEventData eventData)
489 {
490 base.OnPointerUp(eventData);
491 }
492
493 public void _OnPress()
494 {
495 if (!locked && IsActive() && IsInteractable())
496 {
497 if ((bool)soundClick)
498 {
499 SoundManager.current.Play(soundClick);
500 }
501 float realtimeSinceStartup = Time.realtimeSinceStartup;
502 if (lastButton == this && onDoubleClick != null && realtimeSinceStartup - lastClicked < doubleClickTime)
503 {
504 onDoubleClick();
505 lastButton = null;
506 }
507 else
508 {
509 lastClicked = realtimeSinceStartup;
510 lastButton = this;
511 base.onClick.Invoke();
512 }
513 }
514 }
515
516 public void OnPress()
517 {
518 Invoke("_OnPress", 0.01f);
519 }
520
521 public void AddHighlight(Func<bool> killCondition)
522 {
523 base.gameObject.AddComponent<UIButtonHighlighter>().Set(killCondition);
524 }
525
526 public void DoHighlightTransition(bool instant = false)
527 {
528 DoStateTransition(SelectionState.Highlighted, instant);
529 }
530
531 public void DoNormalTransition(bool instant = true)
532 {
533 DoStateTransition(SelectionState.Normal, instant);
534 }
535
536 protected override void DoStateTransition(SelectionState state, bool instant)
537 {
538 if ((waiting && state == SelectionState.Highlighted) || !Application.isPlaying)
539 {
540 return;
541 }
542 if (!base.interactable)
543 {
544 state = SelectionState.Disabled;
545 }
546 if ((bool)highlightTarget)
547 {
548 highlightTarget.DoStateTransition(state, instant: false);
549 }
550 if (selected && !imageCheck)
551 {
552 if (state == SelectionState.Highlighted)
553 {
554 ShowTooltip();
555 }
556 state = SelectionState.Selected;
557 }
558 switch (state)
559 {
560 case SelectionState.Normal:
561 if (scaleIcon != 1f)
562 {
563 icon.transform.localScale = originalIconScale;
564 }
565 break;
566 case SelectionState.Highlighted:
567 currentHighlight = this;
568 if (lastState != SelectionState.Pressed)
569 {
570 ShowTooltip();
571 }
572 if (scaleIcon != 1f && base.interactable)
573 {
574 icon.transform.localScale = new Vector3(scaleIcon, scaleIcon, 1f);
575 }
576 if (lastState != SelectionState.Pressed && (bool)soundHighlight)
577 {
578 SoundManager.current.Play(soundHighlight);
579 }
580 break;
581 case SelectionState.Pressed:
582 if (base.transition == Transition.SpriteSwap && base.spriteState.pressedSprite == null)
583 {
584 SpriteState spriteState = base.spriteState;
585 spriteState.pressedSprite = spriteState.highlightedSprite;
586 base.spriteState = spriteState;
587 }
588 if (scaleIcon != 1f)
589 {
590 icon.transform.localScale = new Vector3(scaleIcon, scaleIcon, 1f) * 0.9f;
591 buttons.Add(this);
592 }
593 if ((bool)animeHold)
594 {
595 if (tween == null)
596 {
597 tween = animeHold.Play(animeTarget ? animeTarget : base.transform).SetAutoKill(autoKillOnCompletion: false);
598 }
599 else
600 {
601 tween.Restart();
602 }
603 animating = true;
604 buttons.Add(this);
605 }
606 break;
607 default:
608 if (scaleIcon != 1f)
609 {
610 icon.transform.localScale = originalIconScale;
611 }
612 if ((bool)animeHold && tween != null && !Input.GetMouseButton(0))
613 {
614 tween.PlayBackwards();
615 animating = false;
616 }
617 break;
618 case SelectionState.Disabled:
619 break;
620 }
621 lastState = state;
622 if (base.transition != Transition.ColorTint)
623 {
624 base.DoStateTransition(state, instant);
625 return;
626 }
627 ColorTween(state switch
628 {
629 SelectionState.Normal => base.colors.normalColor,
630 SelectionState.Highlighted => base.colors.highlightedColor,
631 SelectionState.Pressed => base.colors.pressedColor,
632 SelectionState.Disabled => base.colors.disabledColor,
633 _ => Color.white,
634 } * base.colors.colorMultiplier, instant);
635 }
636
637 private void ColorTween(Color targetColor, bool instant)
638 {
639 if (!(base.targetGraphic == null))
640 {
641 for (int i = 0; i < Graphics.Count; i++)
642 {
643 Graphics[i].CrossFadeColor(targetColor, (!instant) ? base.colors.fadeDuration : 0f, ignoreTimeScale: true, useAlpha: true);
644 }
645 }
646 }
647
648 public override Selectable FindSelectableOnDown()
649 {
650 if (base.navigation.selectOnDown != null)
651 {
652 return base.FindSelectableOnDown();
653 }
654 return FindSelectable(Quaternion.Euler(0f, 0f, navigationFix) * Vector3.down);
655 }
656
657 public override Selectable FindSelectableOnUp()
658 {
659 if (base.navigation.selectOnUp != null)
660 {
661 return base.FindSelectableOnUp();
662 }
663 return FindSelectable(Quaternion.Euler(0f, 0f, navigationFix) * Vector3.up);
664 }
665
666 public override Selectable FindSelectableOnLeft()
667 {
668 if (base.navigation.selectOnLeft != null)
669 {
670 return base.FindSelectableOnLeft();
671 }
672 return FindSelectable(Quaternion.Euler(0f, 0f, navigationFix) * Vector3.left);
673 }
674
675 public override Selectable FindSelectableOnRight()
676 {
677 if (base.navigation.selectOnRight != null)
678 {
679 return base.FindSelectableOnRight();
680 }
681 return FindSelectable(Quaternion.Euler(0f, 0f, navigationFix) * Vector3.right);
682 }
683
684 public void SetNavigation(UIButton up, UIButton down = null, UIButton left = null, UIButton right = null)
685 {
686 Navigation navigation = base.navigation;
687 navigation.mode = Navigation.Mode.Explicit;
688 navigation.selectOnUp = up;
689 navigation.selectOnDown = down;
690 navigation.selectOnLeft = left;
691 navigation.selectOnRight = right;
692 base.navigation = navigation;
693 }
694
695 public override bool IsActive()
696 {
697 if (IsDestroyed())
698 {
699 return false;
700 }
701 return base.IsActive();
702 }
703
704 public static void UpdateButtons()
705 {
706 if ((bool)currentPressedButton && onPressed != null)
707 {
708 onPressed();
709 }
710 if (Input.GetMouseButton(0) || buttons.Count == 0)
711 {
712 return;
713 }
714 foreach (UIButton button in buttons)
715 {
716 if ((bool)button && (bool)button.gameObject)
717 {
718 if (button.animating)
719 {
720 button.tween.PlayBackwards();
721 button.animating = false;
722 }
723 if ((bool)button.icon && button.scaleIcon != 1f)
724 {
725 button.icon.transform.localScale = button.originalIconScale;
726 }
727 }
728 }
729 buttons.Clear();
730 }
731
732 public void SetInteractableWithAlpha(bool enable)
733 {
734 CanvasGroup canvasGroup = base.gameObject.GetComponent<CanvasGroup>();
735 if (!canvasGroup)
736 {
737 canvasGroup = base.gameObject.AddComponent<CanvasGroup>();
738 }
739 canvasGroup.alpha = (enable ? 1f : 0.5f);
740 base.interactable = enable;
741 }
742
743 public virtual void ApplySkin()
744 {
745 if ((bool)skinRoot)
746 {
747 SkinAsset_Button button = skinRoot.GetButton();
748 base.transition = button.transition;
749 SpriteState spriteState = base.spriteState;
750 spriteState.highlightedSprite = button.spriteHighlight;
751 if (base.transition == Transition.ColorTint)
752 {
753 base.image.color = Color.white;
754 ColorBlock colorBlock = base.colors;
755 colorBlock.normalColor = button.color;
756 colorBlock.highlightedColor = button.colorHighlight;
757 base.colors = colorBlock;
758 }
759 else
760 {
761 base.image.color = button.color;
762 }
763 base.spriteState = spriteState;
764 base.image.sprite = button.spriteNormal;
765 }
766 }
767
768 public static void TryHihlight()
769 {
771 UIButton componentOf = InputModuleEX.GetComponentOf<UIButton>();
772 if ((bool)componentOf)
773 {
774 componentOf.DoHighlightTransition();
775 }
776 }
777
778 public static void TryShowTip(Transform root = null, bool highlight = true, bool ignoreWhenRightClick = true)
779 {
780 TryShowTip<UIButton>(root, highlight, ignoreWhenRightClick);
781 }
782
783 public static void TryShowTip<T>(Transform root = null, bool highlight = true, bool ignoreWhenRightClick = true) where T : UIButton
784 {
785 actionTooltip = delegate
786 {
788 T componentOf = InputModuleEX.GetComponentOf<T>();
789 if ((bool)componentOf && componentOf.tooltip.enable)
790 {
792 if ((bool)componentOf && (root == null || componentOf.transform.IsChildOf(root)))
793 {
794 if (highlight)
795 {
796 componentOf.DoHighlightTransition();
797 }
798 try
799 {
800 componentOf.ShowTooltipForced(ignoreWhenRightClick);
801 }
802 catch
803 {
804 }
805 }
806 }
807 };
808 }
809}
ButtonType
Definition: ButtonType.cs:2
Definition: Anime.cs:6
virtual Tween Play(Transform trans, UnityAction onComplete=null, float duration=-1f, float delay=0f)
Definition: Anime.cs:7
void WaitForEndOfFrame(Action action)
Definition: BaseCore.cs:61
static BaseCore Instance
Definition: BaseCore.cs:11
bool wasConsumed
Definition: ButtonState.cs:51
Definition: EInput.cs:8
static bool IsConsumed
Definition: EInput.cs:393
static void Consume(int _skipFrame)
Definition: EInput.cs:656
static bool isShiftDown
Definition: EInput.cs:261
static ButtonState rightMouse
Definition: EInput.cs:351
static int skipFrame
Definition: EInput.cs:287
static void UpdateEventData()
Selectable.Transition transition
static Sprite Get(string id)
Definition: SpriteSheet.cs:28
bool enable
Definition: TooltipData.cs:7
void ShowTooltip(TooltipData data, Transform target)
static TooltipManager Instance
void HideTooltips(bool immediate=false)
virtual string Name
Definition: UIButton.cs:19
virtual void OnClick(UIButton b)
Definition: UIButton.cs:68
virtual bool ShouldHighlight()
Definition: UIButton.cs:51
virtual bool KeepVisibleWhenHighlighted
Definition: UIButton.cs:31
virtual void OnSetItem(UIButton b)
Definition: UIButton.cs:72
virtual Sprite SpriteHighlight
Definition: UIButton.cs:21
virtual bool Hidden
Definition: UIButton.cs:37
virtual bool IsSelectable
Definition: UIButton.cs:25
virtual Vector3 SpriteScale
Definition: UIButton.cs:35
virtual bool UseIconForHighlight
Definition: UIButton.cs:29
virtual Color SpriteColor
Definition: UIButton.cs:33
virtual Transition Transition
Definition: UIButton.cs:39
virtual Sprite GetSprite()
Definition: UIButton.cs:41
virtual void OnHover(UIButton b)
Definition: UIButton.cs:64
virtual Sprite GetSprite(bool highlight)
Definition: UIButton.cs:46
virtual string pathSprite
Definition: UIButton.cs:23
virtual void OnShowContextMenu(UIContextMenu m)
Definition: UIButton.cs:60
virtual void SetSubText(UIText t)
Definition: UIButton.cs:76
virtual string TextTip
Definition: UIButton.cs:17
virtual bool AdjustImageSize
Definition: UIButton.cs:27
virtual void OnAddedToBar()
Definition: UIButton.cs:56
bool always
Definition: UIButton.cs:15
UIText subText2
Definition: UIButton.cs:106
UIText subText
Definition: UIButton.cs:104
static UIButton currentHighlight
Definition: UIButton.cs:90
override void DoStateTransition(SelectionState state, bool instant)
Definition: UIButton.cs:536
bool instantClick
Definition: UIButton.cs:124
bool animating
Definition: UIButton.cs:160
float navigationFix
Definition: UIButton.cs:120
void SetCheck(bool check)
Definition: UIButton.cs:332
Image icon
Definition: UIButton.cs:110
SoundData soundHighlight
Definition: UIButton.cs:132
Image imageCheck
Definition: UIButton.cs:112
void DoHighlightTransition(bool instant=false)
Definition: UIButton.cs:526
Anime animeClick
Definition: UIButton.cs:136
static List< UIButton > buttons
Definition: UIButton.cs:182
Tween tween
Definition: UIButton.cs:176
void ToggleCheck()
Definition: UIButton.cs:327
Graphic[] targetGraphics
Definition: UIButton.cs:114
UIText keyText
Definition: UIButton.cs:108
override bool IsActive()
Definition: UIButton.cs:695
static float lastClicked
Definition: UIButton.cs:94
static bool waiting
Definition: UIButton.cs:180
UIText mainText
Definition: UIButton.cs:102
Transform animeTarget
Definition: UIButton.cs:134
SelectionState lastState
Definition: UIButton.cs:178
void OnPress()
Definition: UIButton.cs:516
Action< int > onInputWheel
Definition: UIButton.cs:148
static UIButton lastButton
Definition: UIButton.cs:86
int refInt
Definition: UIButton.cs:154
static float doubleClickTime
Definition: UIButton.cs:96
Anime animeHold
Definition: UIButton.cs:138
void SetToggleWithScore(bool isOn, Action< bool > onToggle, int? score)
Definition: UIButton.cs:355
void AddHighlight(Func< bool > killCondition)
Definition: UIButton.cs:521
bool isChecked
Definition: UIButton.cs:122
override void OnEnable()
Definition: UIButton.cs:234
Vector3 originalIconScale
Definition: UIButton.cs:166
static UIButton lastHovered
Definition: UIButton.cs:88
virtual bool CanDragLeftButton
Definition: UIButton.cs:210
virtual bool CanMiddleClick()
Definition: UIButton.cs:212
void SetTooltip(Action< UITooltip > onShowTooltip=null, bool enable=true)
Definition: UIButton.cs:361
void ShowTooltipForced(bool ignoreWhenRightClick=true)
Definition: UIButton.cs:387
override void OnPointerUp(PointerEventData eventData)
Definition: UIButton.cs:478
static void UpdateButtons()
Definition: UIButton.cs:704
void SetItem(Item i)
Definition: UIButton.cs:259
virtual void RefreshItem()
Definition: UIButton.cs:269
static Vector2 buttonPos
Definition: UIButton.cs:98
void SetTooltip(string id, Action< UITooltip > onShowTooltip=null, bool enable=true)
Definition: UIButton.cs:366
ButtonType buttonType
Definition: UIButton.cs:140
static void TryHihlight()
Definition: UIButton.cs:768
UIButton highlightTarget
Definition: UIButton.cs:169
List< Graphic > m_graphics
Definition: UIButton.cs:174
static Action onPressed
Definition: UIButton.cs:100
void Toggle()
Definition: UIButton.cs:322
static bool DoSlide
Definition: UIButton.cs:82
BaseSkinRoot skinRoot
Definition: UIButton.cs:142
void SetTooltipLang(string lang=null)
Definition: UIButton.cs:373
override void Awake()
Definition: UIButton.cs:221
float slideX
Definition: UIButton.cs:118
override Selectable FindSelectableOnUp()
Definition: UIButton.cs:657
List< Graphic > Graphics
Definition: UIButton.cs:187
override void OnPointerClick(PointerEventData eventData)
Definition: UIButton.cs:446
virtual void ApplySkin()
Definition: UIButton.cs:743
Action onDoubleClick
Definition: UIButton.cs:144
void SetToggle(bool isOn, Action< bool > onToggle=null)
Definition: UIButton.cs:341
void SetInteractableWithAlpha(bool enable)
Definition: UIButton.cs:732
static UIButton currentPressedButton
Definition: UIButton.cs:92
bool selected
Definition: UIButton.cs:163
void SetNavigation(UIButton up, UIButton down=null, UIButton left=null, UIButton right=null)
Definition: UIButton.cs:684
virtual void ShowTooltip()
Definition: UIButton.cs:379
void ColorTween(Color targetColor, bool instant)
Definition: UIButton.cs:637
object refObj
Definition: UIButton.cs:151
static Action actionTooltip
Definition: UIButton.cs:184
SoundData soundClick
Definition: UIButton.cs:130
string refStr
Definition: UIButton.cs:157
override Selectable FindSelectableOnRight()
Definition: UIButton.cs:675
TooltipData tooltip
Definition: UIButton.cs:128
UISelectableGroup group
Definition: UIButton.cs:126
override void OnPointerDown(PointerEventData eventData)
Definition: UIButton.cs:395
override Selectable FindSelectableOnDown()
Definition: UIButton.cs:648
override Selectable FindSelectableOnLeft()
Definition: UIButton.cs:666
float scaleIcon
Definition: UIButton.cs:116
virtual void OnHover()
Definition: UIButton.cs:312
Action onRightClick
Definition: UIButton.cs:146
static bool locked
Definition: UIButton.cs:84
void _OnPress()
Definition: UIButton.cs:493
static void TryShowTip(Transform root=null, bool highlight=true, bool ignoreWhenRightClick=true)
Definition: UIButton.cs:778
void DoNormalTransition(bool instant=true)
Definition: UIButton.cs:531
Item item
Definition: UIButton.cs:172
virtual void OnMiddleClick(bool forceClick)
Definition: UIButton.cs:217
void OnPointerUpOnDrag(PointerEventData eventData)
Definition: UIButton.cs:488
static float timeSinceClosed
void Select(UIButton button, bool check=true)
Definition: UIText.cs:6