您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

73 行
1.4 KiB

  1. using System;
  2. using CIG.Translation;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class HUDConfirmView : GUIView
  6. {
  7. public void OnOKButtonClicked()
  8. {
  9. ((HUDConfirmState)this.State).OKClicked();
  10. }
  11. public void OnCancelButtonClicked()
  12. {
  13. ((HUDConfirmState)this.State).CancelClicked();
  14. }
  15. public void OnFlipButtonClicked()
  16. {
  17. ((HUDConfirmState)this.State).FlipClicked();
  18. }
  19. public void OnInstantButtonClicked()
  20. {
  21. ((HUDConfirmState)this.State).InstantClicked();
  22. }
  23. public void HideHint()
  24. {
  25. this._hintLabel.gameObject.SetActive(false);
  26. }
  27. public void SetHintText(ILocalizedString text)
  28. {
  29. this._hintLabel.gameObject.SetActive(true);
  30. this._hintLabel.LocalizedString = text;
  31. }
  32. public void SetFlipButtonVisible(bool visible)
  33. {
  34. this._flipButton.gameObject.SetActive(visible);
  35. }
  36. public void UpdateImmediateCost(decimal? cost)
  37. {
  38. GameObject gameObject = this._instantButton.gameObject;
  39. if (cost != null)
  40. {
  41. if (!gameObject.activeSelf)
  42. {
  43. gameObject.SetActive(true);
  44. }
  45. this._instantCostLabel.LocalizedString = Localization.Integer(cost.Value);
  46. }
  47. else if (gameObject.activeSelf)
  48. {
  49. gameObject.SetActive(false);
  50. }
  51. }
  52. [SerializeField]
  53. private LocalizedText _hintLabel;
  54. [SerializeField]
  55. private Button _flipButton;
  56. [SerializeField]
  57. private Button _instantButton;
  58. [SerializeField]
  59. private LocalizedText _instantCostLabel;
  60. }