ResultIncomeMgr.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. using System;
  2. using BackupParamAccessor;
  3. using PlayerStatus;
  4. using Schedule;
  5. using UnityEngine;
  6. public class ResultIncomeMgr : BaseCreatePanel
  7. {
  8. public override void Init()
  9. {
  10. this.m_goPanel = base.GetPanel("ResultIncomePanel");
  11. this.m_ctrl = base.GetCtrl<ResultIncomeCtrl>();
  12. this.m_ctrl.Init(this, this.m_goPanel);
  13. this.m_api = new ResultIncomeAPI();
  14. this.m_goPanel.SetActive(false);
  15. }
  16. public void OpenResultIncomePanel()
  17. {
  18. Debug.Log("収支リザルトをオープンしました。");
  19. this.m_api.SceneStart(this, new ResultIncomeAPI.dgOnSceneStartCallBack(this.OpenResultIncomeCallBack));
  20. }
  21. public void OpenResultIncomeCallBack()
  22. {
  23. base.BaseOpenPanel();
  24. }
  25. protected override void OpenPanel()
  26. {
  27. ResultIncomeCtrl.ResultIncome loadData = this.LoadData();
  28. this.ExecuteRelatedAPI();
  29. this.m_ctrl.CreateViewer(loadData);
  30. }
  31. private void ExecuteRelatedAPI()
  32. {
  33. }
  34. private ResultIncomeCtrl.ResultIncome LoadData()
  35. {
  36. if (!this.m_initSchedule)
  37. {
  38. this.m_diff = ScheduleAPI.OneDayParamDiff(null);
  39. this.m_initSchedule = true;
  40. }
  41. ResultIncomeCtrl.ResultIncome resultIncome = new ResultIncomeCtrl.ResultIncome();
  42. if (this.m_diff == null)
  43. {
  44. Debug.LogWarning("Schedule.ScheduleAPI.OneDayParamDiff()の戻り値がNULLでしたので収支の結果を表示できません。");
  45. return resultIncome;
  46. }
  47. Status status = GameMain.Instance.CharacterMgr.status;
  48. resultIncome.balance = 0L;
  49. if (RhythmAction_Mgr.DoChallengeDance)
  50. {
  51. RhythmAction_Mgr.DoChallengeDance = false;
  52. resultIncome.bonusIncome = (long)RhythmAction_Mgr.DanceReward;
  53. GameMain.Instance.CharacterMgr.status.clubGauge = 0;
  54. RhythmAction_Mgr.RewardRecet();
  55. }
  56. else
  57. {
  58. resultIncome.bonusIncome = 0L;
  59. }
  60. this.m_dayIncome = this.m_diff.clubMoney;
  61. resultIncome.workingFunds = this.m_diff.clubMoney;
  62. resultIncome.clubIncome = status.money - this.m_diff.clubMoney - resultIncome.bonusIncome;
  63. resultIncome.totalAmount = status.money;
  64. resultIncome.clientEvaluation = this.m_diff.clubEvaluation;
  65. resultIncome.acquisitionEvaluation = status.clubEvaluation - this.m_diff.clubEvaluation;
  66. resultIncome.result = status.clubEvaluation;
  67. return resultIncome;
  68. }
  69. public void CloseResultIncome()
  70. {
  71. GameMain.Instance.SysDlg.Close();
  72. base.BaseClosePanel();
  73. }
  74. protected override void AfterClose()
  75. {
  76. if (this.sceneMgr != null)
  77. {
  78. this.m_api.EndNextScene(new ResultIncomeAPI.dgOnSceneFinalCallBack(this.sceneMgr.CloseScene));
  79. }
  80. }
  81. protected override void SetFadeTargetPanel()
  82. {
  83. this.fadeTargetPanel = this.m_goPanel;
  84. }
  85. private ResultIncomeCtrl m_ctrl;
  86. private ResultIncomeAPI m_api;
  87. private Params m_diff;
  88. private long m_dayIncome;
  89. private bool m_initSchedule;
  90. }