YotogiSkillLockUnit.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using MaidStatus;
  3. using UnityEngine;
  4. public class YotogiSkillLockUnit : MonoBehaviour
  5. {
  6. public YotogiSkillData skillData { get; private set; }
  7. public new bool enabled
  8. {
  9. get
  10. {
  11. return this.checkBox.enabled;
  12. }
  13. set
  14. {
  15. if (!value)
  16. {
  17. this.checkBox.check = false;
  18. }
  19. this.checkBox.enabled = value;
  20. if (value)
  21. {
  22. this.checkBox.CheckMarkOffObject.GetComponent<UISprite>().color = new Color(1f, 1f, 1f, 0.5f);
  23. }
  24. else
  25. {
  26. this.checkBox.CheckMarkOffObject.GetComponent<UISprite>().color = new Color(0.5f, 0.5f, 0.5f, 0.5f);
  27. }
  28. }
  29. }
  30. public void Awake()
  31. {
  32. NDebug.AssertNull(this.checkBox);
  33. this.checkBox.onClick.Add(new Action<WFCheckBox>(this.OnClickCheckBox));
  34. }
  35. public void SetSkillData(YotogiSkillData skillData)
  36. {
  37. this.skillData = skillData;
  38. if (skillData == null)
  39. {
  40. WFCheckBox wfcheckBox = this.checkBox;
  41. bool flag = false;
  42. this.checkBox.check = flag;
  43. wfcheckBox.enabled = flag;
  44. this.checkBox.CheckMarkOffObject.GetComponent<UISprite>().color = new Color(0.5f, 0.5f, 0.5f, 0.5f);
  45. return;
  46. }
  47. this.checkBox.check = skillData.lockSkillExp;
  48. }
  49. public void OnClickCheckBox(WFCheckBox checkBox)
  50. {
  51. this.skillData.lockSkillExp = checkBox.check;
  52. }
  53. [SerializeField]
  54. public WFCheckBox checkBox;
  55. }