DescResultTraining.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class DescResultTraining : DescResulteBase
  5. {
  6. public override void Init(ResultWorkMgr resultWorkMgr, ResultWorkCtrl ctrl, GameObject goPanel)
  7. {
  8. base.Init(resultWorkMgr, ctrl, goPanel);
  9. this.m_lMaidClassExp = new DescResulteBase.ParamSet(this.m_goMaidParameterParent, "MaidClassExp");
  10. this.m_lMaidClassLv = new DescResulteBase.ParamSet(this.m_goMaidParameterParent, "MaidClassLevel");
  11. this.m_listMaidItem.Add(this.m_lMaidClassExp.GetVariableItem());
  12. this.m_listMaidItem.Add(this.m_lMaidClassLv.GetVariableItem());
  13. this.m_listAnimationTarget.Add(this.m_lMaidClassExp.ValueObj);
  14. this.m_listAnimationTarget.Add(this.m_lMaidClassLv.ValueObj);
  15. this.SettingSalon();
  16. this.m_goCommuBonus = UTY.GetChildObject(this.m_goMaidStatus, "CommuBonus", false);
  17. this.m_commuBonusIcon = this.m_goCommuBonus.GetComponent<UITexture>();
  18. this.m_goCommuBonus.SetActive(false);
  19. this.m_goPerfectSuccess = UTY.GetChildObject(this.m_goMaidStatus, "PerfectSuccess", false);
  20. this.m_perfectSuccessIcon = this.m_goPerfectSuccess.GetComponent<UITexture>();
  21. this.m_goCommuBonus.SetActive(false);
  22. base.gameObject.SetActive(false);
  23. }
  24. private void SettingSalon()
  25. {
  26. this.m_goSalonStatus = UTY.GetChildObject(this.viewPanel, "SalonStatus", false);
  27. this.m_goSalonParameterParent = UTY.GetChildObject(this.m_goSalonStatus, "ParameterParent", false);
  28. this.m_lWorkingFunds = new DescResulteBase.ParamSet(this.m_goSalonParameterParent, "WorkingFunds");
  29. this.m_listSalonStatus = new List<ScheduleCtrl.VariableItem>
  30. {
  31. this.m_lWorkingFunds.GetVariableItem()
  32. };
  33. this.m_spBGOfSalonParameterViewer = UTY.GetChildObject(this.m_goSalonStatus, "BG", false).GetComponent<UISprite>();
  34. this.m_heightOfSalonParameterTitle = UTY.GetChildObject(this.m_goSalonStatus, "Title", false).GetComponent<UISprite>().height;
  35. }
  36. public override void UpdateView(string buttonName)
  37. {
  38. this.m_resultWorkCtrl.SetSelectedRowActive(buttonName);
  39. int slotNoByButtonName = ScheduleCtrl.GetSlotNoByButtonName(buttonName);
  40. ResultWorkCtrl.ResultWork resultWorkBySlotNo = this.m_resultWorkCtrl.GetResultWorkBySlotNo(slotNoByButtonName);
  41. if (resultWorkBySlotNo.hasResult)
  42. {
  43. this.SetAcquiredSalonStatusPoints(slotNoByButtonName);
  44. this.SetAcquiredMaidStatusPoints(slotNoByButtonName);
  45. }
  46. else
  47. {
  48. Debug.LogWarning(string.Format("スロットNo={0}には仕事の結果データが存在しません。", slotNoByButtonName));
  49. }
  50. base.ActivePanel(true);
  51. this.ExamineMaidStatusDisplayItem();
  52. }
  53. protected override void UpdateAddValue(ResultWorkCtrl.UpperMaidStatus maidStatus)
  54. {
  55. base.UpdateAddValue(maidStatus);
  56. this.m_lMaidClassExp.AddValueText = base.Sign(maidStatus.maidClassExp);
  57. this.m_lMaidClassLv.AddValueText = base.Sign(maidStatus.maidClassLevel);
  58. }
  59. public void SetAcquiredSalonStatusPoints(int slotNo)
  60. {
  61. ResultWorkCtrl.UpperMaidStatus maidStatusBySlotNo = base.GetMaidStatusBySlotNo(slotNo);
  62. if (maidStatusBySlotNo != null)
  63. {
  64. this.m_lWorkingFunds.AddValueText = base.Sign(maidStatusBySlotNo.workingFunds, "#,0");
  65. bool active = this.ExamineSalonStatusDisplayItem();
  66. this.m_goSalonStatus.SetActive(active);
  67. }
  68. else
  69. {
  70. this.m_goSalonStatus.SetActive(false);
  71. }
  72. }
  73. public void SetAcquiredMaidStatusPoints(int slotNo)
  74. {
  75. ResultWorkCtrl.UpperMaidStatus maidStatusBySlotNo = base.GetMaidStatusBySlotNo(slotNo);
  76. if (maidStatusBySlotNo != null)
  77. {
  78. this.SetMaidStatusValue(maidStatusBySlotNo);
  79. this.SetMaxMaidClassLevelIcon(slotNo, maidStatusBySlotNo.maidLvCompletion);
  80. this.m_goCommuBonus.SetActive(false);
  81. if (maidStatusBySlotNo.givenPerfectSucces)
  82. {
  83. this.m_goPerfectSuccess.SetActive(true);
  84. this.m_perfectSuccessIcon.mainTexture = maidStatusBySlotNo.perfectSuccessIcon;
  85. }
  86. else
  87. {
  88. this.m_goPerfectSuccess.SetActive(false);
  89. this.m_perfectSuccessIcon.mainTexture = null;
  90. }
  91. if (maidStatusBySlotNo.givenCommuBonus)
  92. {
  93. this.m_goCommuBonus.SetActive(true);
  94. this.m_commuBonusIcon.mainTexture = maidStatusBySlotNo.bonusIcon;
  95. base.TweenAnimation(this.m_playedAnimation);
  96. }
  97. else
  98. {
  99. this.m_commuBonusIcon.mainTexture = null;
  100. this.m_goCommuBonus.SetActive(false);
  101. base.TweenAnimation(false);
  102. }
  103. this.m_goMaidStatus.SetActive(true);
  104. }
  105. else
  106. {
  107. this.m_goMaidStatus.SetActive(false);
  108. }
  109. }
  110. private void SetMaxMaidClassLevelIcon(int slotNo, bool reachMaxLevel)
  111. {
  112. string key = slotNo.ToString();
  113. if (this.m_dicResultWork.ContainsKey(key))
  114. {
  115. ResultWorkCtrl.ResultWork resultWork = this.m_dicResultWork[key];
  116. resultWork.goIconMaidClassMax.SetActive(reachMaxLevel);
  117. }
  118. else
  119. {
  120. Debug.LogError(string.Format("不適切なスロットNoが選択されました。選択されたスロットNo=", slotNo + 1));
  121. }
  122. }
  123. private void SetMaidStatusValue(ResultWorkCtrl.UpperMaidStatus maidStatus)
  124. {
  125. this.UpdateAddValue(maidStatus);
  126. }
  127. private bool ExamineSalonStatusDisplayItem()
  128. {
  129. int num = ScheduleCtrl.SetActiveExceptForNothing(this.m_listSalonStatus, "0");
  130. if (num == 0)
  131. {
  132. return false;
  133. }
  134. BaseCreateViewerCtrl.Reposition(this.m_goSalonParameterParent);
  135. this.m_resultWorkCtrl.AdjustParameterViewer(this.m_goSalonParameterParent, num, this.m_heightOfSalonParameterTitle, this.m_spBGOfSalonParameterViewer);
  136. return true;
  137. }
  138. private void ExamineMaidStatusDisplayItem()
  139. {
  140. int num = ScheduleCtrl.SetActiveExceptForNothing(this.m_listMaidItem, "0");
  141. if (num == 0)
  142. {
  143. this.m_spBGOfMaidParameterViewer.height = 133;
  144. return;
  145. }
  146. BaseCreateViewerCtrl.Reposition(this.m_goMaidParameterParent);
  147. this.m_resultWorkCtrl.AdjustParameterViewer(this.m_goMaidParameterParent, num, this.m_heightOfMaidParameterTitle, this.m_spBGOfMaidParameterViewer);
  148. }
  149. private Dictionary<int, GameObject> m_dicMaxLevelMaidClassIcon;
  150. private List<ScheduleCtrl.VariableItem> m_listSalonStatus;
  151. private GameObject m_goSalonStatus;
  152. private GameObject m_goSalonParameterParent;
  153. private GameObject m_goCommuBonus;
  154. private GameObject m_goPerfectSuccess;
  155. private UITexture m_commuBonusIcon;
  156. private UITexture m_perfectSuccessIcon;
  157. private UISprite m_spBGOfSalonParameterViewer;
  158. private int m_heightOfSalonParameterTitle;
  159. private const int NO_PARAM_HEIGHT = 133;
  160. protected DescResulteBase.ParamSet m_lMaidClassLv;
  161. protected DescResulteBase.ParamSet m_lMaidClassExp;
  162. protected DescResulteBase.ParamSet m_lWorkingFunds;
  163. }