YotogiOldFreeSkillSelectManager.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. using System;
  2. using UnityEngine;
  3. using wf;
  4. public class YotogiOldFreeSkillSelectManager : WfScreenChildren
  5. {
  6. public override void Awake()
  7. {
  8. base.Awake();
  9. this.yotogi_mgr_ = base.GetComponentInParent<YotogiOldManager>();
  10. this.load_asset_object = Utility.CreatePrefab(UTY.GetChildObject(base.root_obj, "FreeSkillSelectParent", false).gameObject, "SceneFreeModeSelect/Prefab/FreeSkillSelect", true);
  11. this.free_skill_select_ = this.load_asset_object.AddComponent<FreeSkillSelectOld>();
  12. this.free_skill_select_.SetYotogiManager(this.yotogi_mgr_);
  13. this.ok_btn_ = UTY.GetChildObject(base.root_obj, "CommonPanel/UnderButtonGroup/Next", false).GetComponent<UIButton>();
  14. this.ok_btn_.onClick.Add(new EventDelegate(this, "OnClickOK"));
  15. this.chancel_btn_ = UTY.GetChildObject(base.root_obj, "CommonPanel/UnderButtonGroup/Cancel", false).GetComponent<UIButton>();
  16. this.chancel_btn_.onClick.Add(new EventDelegate(this, "OnClickCancel"));
  17. }
  18. public void OnDestroy()
  19. {
  20. if (this.load_asset_object != null)
  21. {
  22. UnityEngine.Object.Destroy(this.load_asset_object);
  23. }
  24. this.load_asset_object = null;
  25. }
  26. protected override void OnCall()
  27. {
  28. if (this.load_asset_object.transform.parent != UTY.GetChildObject(base.root_obj, "FreeSkillSelectParent", false).transform)
  29. {
  30. this.load_asset_object.transform.SetParent(UTY.GetChildObject(base.root_obj, "FreeSkillSelectParent", false).transform, false);
  31. }
  32. this.ok_btn_.normalSprite = "cm3d2_common_okbuttom";
  33. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  34. this.maid_ = this.yotogi_mgr_.maid;
  35. this.free_skill_select_.SetMaid(this.maid_);
  36. this.free_skill_select_.CreateInstanceButton();
  37. this.maid_.status.currentExcite = 0;
  38. this.yotogi_mgr_.is_free_mode = true;
  39. for (int i = 0; i < characterMgr.GetMaidCount(); i++)
  40. {
  41. Maid maid = characterMgr.GetMaid(i);
  42. if (!(maid == null))
  43. {
  44. maid.Visible = true;
  45. maid.AllProcPropSeqStart();
  46. }
  47. }
  48. characterMgr.GetMan(0).Visible = true;
  49. characterMgr.GetMan(0).AllProcPropSeqStart();
  50. }
  51. protected override bool IsCallFadeIn()
  52. {
  53. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  54. if (characterMgr.IsBusy())
  55. {
  56. return false;
  57. }
  58. Maid man = characterMgr.GetMan(0);
  59. for (int i = 0; i < characterMgr.GetMaidCount(); i++)
  60. {
  61. Maid maid = characterMgr.GetMaid(i);
  62. if (!(maid == null))
  63. {
  64. maid.SetPosOffset(Vector3.zero);
  65. if (1 <= i)
  66. {
  67. maid.Visible = false;
  68. }
  69. }
  70. }
  71. characterMgr.GetMan(0).Visible = false;
  72. this.free_skill_select_.FixSkill();
  73. return true;
  74. }
  75. private void OnClickOK()
  76. {
  77. if (this.yotogi_mgr_.null_mgr.IsExistNextLabel())
  78. {
  79. this.Finish();
  80. }
  81. }
  82. private void OnClickCancel()
  83. {
  84. if (string.IsNullOrEmpty(this.cancel_label))
  85. {
  86. return;
  87. }
  88. this.yotogi_mgr_.null_mgr.SetNextLabel(this.cancel_label);
  89. this.Finish();
  90. }
  91. protected override void OnFadeEnd()
  92. {
  93. this.free_skill_select_.FixSkill();
  94. GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
  95. if (this.yotogi_mgr_.null_mgr.IsExistNextLabel())
  96. {
  97. this.yotogi_mgr_.CallScreen(YotogiOldManager.CallScreenType.Null.ToString());
  98. }
  99. }
  100. public GameObject skill_select_prefab_object
  101. {
  102. get
  103. {
  104. return this.load_asset_object;
  105. }
  106. }
  107. public string cancel_label
  108. {
  109. get
  110. {
  111. return this.cancel_label_;
  112. }
  113. set
  114. {
  115. this.cancel_label_ = value;
  116. }
  117. }
  118. private Maid maid_;
  119. private YotogiOldManager yotogi_mgr_;
  120. private FreeSkillSelectOld free_skill_select_;
  121. private UIButton ok_btn_;
  122. private UIButton chancel_btn_;
  123. private GameObject load_asset_object;
  124. private string cancel_label_ = string.Empty;
  125. }