YotogiFreeSkillSelectManager.cs 3.5 KB

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