Score_Mgr.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using I2.Loc;
  6. using UnityEngine;
  7. using wf;
  8. public class Score_Mgr : PartsMgrBase
  9. {
  10. public bool IsExistMiss
  11. {
  12. get
  13. {
  14. return this.m_IsExistMiss;
  15. }
  16. }
  17. public static Score_Mgr Instance
  18. {
  19. get
  20. {
  21. return Score_Mgr.m_Instance;
  22. }
  23. }
  24. protected override void Start()
  25. {
  26. Score_Mgr.m_Instance = this;
  27. base.Start();
  28. if (!base.IsActive)
  29. {
  30. base.gameObject.SetActive(false);
  31. return;
  32. }
  33. this.m_FlashCombo.gameObject.SetActive(false);
  34. this.m_FlashCombo_Child.gameObject.SetActive(false);
  35. this.m_CharaScoreList.Clear();
  36. this.m_EnemyScoreUI.SetActive(false);
  37. this.m_CharaScoreList.Add(DanceBattle_Mgr.CharaType.Player, new Score_Mgr.CharaScoreData());
  38. this.SetTextandIcon(this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player], this.m_PlayerScoreUI);
  39. if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.VS || RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.BenchMark)
  40. {
  41. this.m_EnemyScoreUI.SetActive(true);
  42. this.m_CharaScoreList.Add(DanceBattle_Mgr.CharaType.Enemy, new Score_Mgr.CharaScoreData());
  43. this.SetTextandIcon(this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Enemy], this.m_EnemyScoreUI);
  44. }
  45. else if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Challenge)
  46. {
  47. this.CSVRead();
  48. }
  49. }
  50. private void CSVRead()
  51. {
  52. string text = RhythmAction_Mgr.Instance.MusicCSV_Path + "reward_data.nei";
  53. if (!GameUty.FileSystem.IsExistentFile(text))
  54. {
  55. NDebug.Assert("表がありません。" + text, false);
  56. }
  57. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
  58. {
  59. using (CsvParser csvParser = new CsvParser())
  60. {
  61. bool condition = csvParser.Open(afileBase);
  62. NDebug.Assert(condition, text + "\nopen failed.");
  63. for (int i = 1; i < csvParser.max_cell_y; i++)
  64. {
  65. if (csvParser.IsCellToExistData(0, i))
  66. {
  67. Score_Mgr.RewardData rewardData = new Score_Mgr.RewardData();
  68. for (int j = 0; j < csvParser.max_cell_x; j++)
  69. {
  70. this.SetRewardData(csvParser, j, i, rewardData);
  71. }
  72. this.m_AllRewardData.Add(rewardData);
  73. }
  74. }
  75. }
  76. }
  77. }
  78. private void SetRewardData(CsvParser csv, int cell_X, int cell_Y, Score_Mgr.RewardData data)
  79. {
  80. switch (cell_X)
  81. {
  82. case 0:
  83. data.Rank = csv.GetCellAsString(cell_X, cell_Y);
  84. break;
  85. case 1:
  86. data.Condition = csv.GetCellAsString(cell_X, cell_Y);
  87. break;
  88. case 2:
  89. data.TargetScore = csv.GetCellAsInteger(cell_X, cell_Y);
  90. break;
  91. case 3:
  92. data.Reward = csv.GetCellAsInteger(cell_X, cell_Y);
  93. break;
  94. }
  95. }
  96. private void SetTextandIcon(Score_Mgr.CharaScoreData data, GameObject score_ui)
  97. {
  98. Transform transform = score_ui.transform.Find("Text/ScoreText");
  99. Transform transform2 = score_ui.transform.Find("IconMask/Icon");
  100. if (transform)
  101. {
  102. data.ScoreText = transform.GetComponent<UILabel>();
  103. }
  104. if (transform2)
  105. {
  106. data.MaidIcon = transform2.GetComponent<UI2DSprite>();
  107. }
  108. }
  109. private void SetNameUI(DanceBattle_Mgr.CharaType chara_type, GameObject score_ui)
  110. {
  111. if (chara_type == DanceBattle_Mgr.CharaType.Player)
  112. {
  113. this.m_CharaScoreList[chara_type].CharaName = RhythmAction_Mgr.Instance.UserMaid.status.charaName.GetFullName(" ");
  114. }
  115. else
  116. {
  117. this.m_CharaScoreList[chara_type].CharaName = DanceBattle_Mgr.EnemyData.Name;
  118. }
  119. if (score_ui.transform.Find("Text/NameText"))
  120. {
  121. UILabel component = score_ui.transform.Find("Text/NameText").GetComponent<UILabel>();
  122. component.text = this.m_CharaScoreList[chara_type].CharaName;
  123. if (chara_type != DanceBattle_Mgr.CharaType.Player && Product.supportMultiLanguage)
  124. {
  125. Localize localize = component.GetComponent<Localize>();
  126. if (localize == null)
  127. {
  128. localize = component.gameObject.AddComponent<Localize>();
  129. }
  130. Utility.SetLocalizeTerm(localize, DanceBattle_Mgr.EnemyData.NameTerm, false);
  131. }
  132. }
  133. }
  134. private void Update()
  135. {
  136. foreach (KeyValuePair<DanceBattle_Mgr.CharaType, Score_Mgr.CharaScoreData> keyValuePair in this.m_CharaScoreList)
  137. {
  138. keyValuePair.Value.ScoreText.text = keyValuePair.Value.nScore.ToString();
  139. if (keyValuePair.Key == DanceBattle_Mgr.CharaType.Player)
  140. {
  141. this.m_ComboText.gameObject.SetActive(keyValuePair.Value.nCombo != 0);
  142. this.m_ComboText.text = keyValuePair.Value.nCombo.ToString();
  143. this.m_FlashCombo.text = this.m_ComboText.text;
  144. this.m_ComboText.color = this.GetTextColor(keyValuePair.Value.nCombo);
  145. this.m_ComboText_Child.color = this.GetTextColor(keyValuePair.Value.nCombo);
  146. }
  147. }
  148. }
  149. private IEnumerator TextScaling()
  150. {
  151. float timer = 0f;
  152. for (;;)
  153. {
  154. if (!RhythmAction_Mgr.Instance.IsPause)
  155. {
  156. timer += RhythmAction_Mgr.Instance.DanceDeltaTime;
  157. }
  158. if (!this.m_FlashCombo.gameObject.activeSelf)
  159. {
  160. this.m_FlashCombo.gameObject.SetActive(true);
  161. this.m_FlashCombo_Child.gameObject.SetActive(true);
  162. }
  163. Color flash_col = this.m_FlashCombo.color;
  164. float rate = Mathf.Sin(Mathf.Clamp01(timer / this.m_ScalingTime) * 180f * 0.0174532924f);
  165. flash_col.a = rate;
  166. this.m_FlashCombo.color = flash_col;
  167. this.m_FlashCombo_Child.color = flash_col;
  168. this.m_ComboText.transform.localScale = Vector3.Lerp(Vector3.one, Vector3.one * this.m_ScalingValue, rate);
  169. if (timer > this.m_ScalingTime)
  170. {
  171. break;
  172. }
  173. yield return null;
  174. }
  175. this.m_FlashCombo.gameObject.SetActive(false);
  176. this.m_FlashCombo_Child.gameObject.SetActive(false);
  177. yield break;
  178. yield break;
  179. }
  180. private void ScoreScaling(float time)
  181. {
  182. float t = Mathf.Sin(Mathf.Clamp01(time / this.m_ScoreScalingTime) * 180f * 0.0174532924f);
  183. this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].ScoreText.transform.localScale = Vector3.Lerp(Vector3.one, Vector3.one * this.m_ScoreScaling, t);
  184. }
  185. private int BaceScore(Dance_Note.Evaluation evalue)
  186. {
  187. if (this.m_EvalueSetList.Any((Score_Mgr.EvalueSetting e) => e.Evalue == evalue))
  188. {
  189. return this.m_EvalueSetList.SingleOrDefault((Score_Mgr.EvalueSetting e) => e.Evalue == evalue).BaceScore;
  190. }
  191. return 0;
  192. }
  193. private int JudgeNumber(Dance_Note.Evaluation evalue)
  194. {
  195. if (this.m_EvalueSetList.Any((Score_Mgr.EvalueSetting e) => e.Evalue == evalue))
  196. {
  197. return this.m_EvalueSetList.SingleOrDefault((Score_Mgr.EvalueSetting e) => e.Evalue == evalue).JudgeNo;
  198. }
  199. return 0;
  200. }
  201. private int Combo_Correct(int combo)
  202. {
  203. int result = 0;
  204. if (combo >= 50)
  205. {
  206. result = Mathf.Min(combo / 50 * 50 + 50, this.m_Max_Correct);
  207. }
  208. else if (combo >= 10)
  209. {
  210. result = 50;
  211. }
  212. return result;
  213. }
  214. private Color GetTextColor(int combo)
  215. {
  216. Color result = Color.white;
  217. foreach (Score_Mgr.ComboTextColor comboTextColor2 in this.m_ComboTextColor)
  218. {
  219. if (combo < comboTextColor2.Combo)
  220. {
  221. break;
  222. }
  223. result = comboTextColor2.TextColor;
  224. }
  225. return result;
  226. }
  227. private float Score_Rate()
  228. {
  229. int num = this.m_EvalueCombo[Dance_Note.Evaluation.PERFECT] + this.m_EvalueCombo[Dance_Note.Evaluation.GREAT];
  230. if (num > 0)
  231. {
  232. return (float)num / (float)this.m_NoteCount * 100f;
  233. }
  234. return 0f;
  235. }
  236. private bool GoalToTarget(Score_Mgr.RewardData data)
  237. {
  238. bool result = false;
  239. if (data.Condition == ">")
  240. {
  241. result = (this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].nScore > (long)data.TargetScore);
  242. }
  243. else if (data.Condition == ">=")
  244. {
  245. result = (this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].nScore >= (long)data.TargetScore);
  246. }
  247. else if (data.Condition == "<")
  248. {
  249. result = (this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].nScore < (long)data.TargetScore);
  250. }
  251. else if (data.Condition == "<=")
  252. {
  253. result = (this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].nScore <= (long)data.TargetScore);
  254. }
  255. return result;
  256. }
  257. private int GetVoltageCorrect(int voltage, Dance_Note.Evaluation evalue)
  258. {
  259. if (this.m_VoltageCorrect.Any((Score_Mgr.VoltageCorrect e) => e.Voltage == voltage) && evalue != Dance_Note.Evaluation.MISS)
  260. {
  261. return this.m_VoltageCorrect.SingleOrDefault((Score_Mgr.VoltageCorrect e) => e.Voltage == voltage).Correct;
  262. }
  263. return 0;
  264. }
  265. private void DecideReward()
  266. {
  267. long num = 0L;
  268. long num2 = 0L;
  269. foreach (Score_Mgr.RewardData rewardData in this.m_AllRewardData)
  270. {
  271. num2 = num - this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].nScore;
  272. Result_Display.SetResultData("Rank", rewardData.Rank, Result_Display.ResultType.Image);
  273. Result_Display.SetResultData("Money", Utility.ConvertMoneyText(rewardData.Reward), Result_Display.ResultType.String);
  274. if ((long)rewardData.TargetScore <= this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].nScore)
  275. {
  276. RhythmAction_Mgr.Instance.SetDanceReward(rewardData.Reward);
  277. GameMain.Instance.CharacterMgr.status.money += (long)rewardData.Reward;
  278. break;
  279. }
  280. num = (long)rewardData.TargetScore;
  281. }
  282. if (num2 <= 0L)
  283. {
  284. Result_Display.SetResultData("NextRank", "RankMax", Result_Display.ResultType.Image);
  285. }
  286. else
  287. {
  288. Result_Display.SetResultData("NextRank", Utility.ConvertMoneyText(num2), Result_Display.ResultType.String);
  289. }
  290. }
  291. private int GetAppealMultiple(DanceBattle_Mgr.CharaType chara_type)
  292. {
  293. if (!Appeal_Mgr.Instance.IsActive || !Appeal_Mgr.Instance.GetAppealData(chara_type).IsAppealNow)
  294. {
  295. return 1;
  296. }
  297. Appeal_Mgr.Instance.AddAppealCombo(chara_type);
  298. if (RhythmAction_Mgr.IsVSDance)
  299. {
  300. return this.m_AppealMagnification;
  301. }
  302. return 1;
  303. }
  304. public long GetScore(DanceBattle_Mgr.CharaType type)
  305. {
  306. if (this.m_CharaScoreList.ContainsKey(type))
  307. {
  308. return this.m_CharaScoreList[type].nScore;
  309. }
  310. return 0L;
  311. }
  312. public int GetCombo(DanceBattle_Mgr.CharaType type)
  313. {
  314. if (this.m_CharaScoreList.ContainsKey(type))
  315. {
  316. return this.m_CharaScoreList[type].nCombo;
  317. }
  318. return 0;
  319. }
  320. public void AddScore(Dance_Note.Evaluation evalue, DanceBattle_Mgr.CharaType chara_type, bool is_special)
  321. {
  322. if (this.m_CharaScoreList.ContainsKey(chara_type))
  323. {
  324. if (evalue != Dance_Note.Evaluation.PERFECT && evalue != Dance_Note.Evaluation.GREAT)
  325. {
  326. this.m_CharaScoreList[chara_type].nCombo = 0;
  327. if (chara_type == DanceBattle_Mgr.CharaType.Player)
  328. {
  329. this.m_IsExistMiss = true;
  330. }
  331. }
  332. else
  333. {
  334. this.m_CharaScoreList[chara_type].nCombo++;
  335. if (chara_type == DanceBattle_Mgr.CharaType.Player)
  336. {
  337. base.StartCoroutine(this.TextScaling());
  338. }
  339. }
  340. if (this.m_CharaScoreList[chara_type].nCombo > 99999)
  341. {
  342. this.m_CharaScoreList[chara_type].nCombo = 99999;
  343. }
  344. int voltage = (chara_type != DanceBattle_Mgr.CharaType.Player) ? DanceBattle_Mgr.EnemyData.UseVoltage : Voltage_Mgr.Instance.VoltageStage;
  345. if (is_special)
  346. {
  347. for (int i = 0; i < Note_Mgr.Instance.GetSpecial; i++)
  348. {
  349. int num = this.BaceScore(evalue) + this.JudgeNumber(evalue) * this.Combo_Correct(this.m_CharaScoreList[chara_type].nCombo + i) + this.GetVoltageCorrect(voltage, evalue);
  350. num *= this.GetAppealMultiple(chara_type);
  351. this.m_CharaScoreList[chara_type].nScore += (long)num;
  352. }
  353. if (chara_type == DanceBattle_Mgr.CharaType.Player)
  354. {
  355. base.StartCoroutine(RhythmAction_Mgr.Instance.DanceTimeCoroutine(this.m_ScoreScalingTime, new Action<float>(this.ScoreScaling), null));
  356. }
  357. }
  358. else
  359. {
  360. int num2 = this.BaceScore(evalue) + this.JudgeNumber(evalue) * this.Combo_Correct(this.m_CharaScoreList[chara_type].nCombo) + this.GetVoltageCorrect(voltage, evalue);
  361. if (MotionAction_Mgr.IsCaptureOK && chara_type == DanceBattle_Mgr.CharaType.Player)
  362. {
  363. num2 += this.m_McSuccesBonus;
  364. }
  365. num2 *= this.GetAppealMultiple(chara_type);
  366. this.m_CharaScoreList[chara_type].nScore += (long)num2;
  367. }
  368. if (this.m_CharaScoreList[chara_type].nScore > 9999999999L)
  369. {
  370. this.m_CharaScoreList[chara_type].nScore = 9999999999L;
  371. }
  372. if (chara_type == DanceBattle_Mgr.CharaType.Player)
  373. {
  374. this.m_ComboCount = Mathf.Max(this.m_ComboCount, this.m_CharaScoreList[chara_type].nCombo);
  375. Dictionary<Dance_Note.Evaluation, int> evalueCombo;
  376. (evalueCombo = this.m_EvalueCombo)[evalue] = evalueCombo[evalue] + 1;
  377. this.m_NoteCount++;
  378. }
  379. if (this.m_CharaScoreList[chara_type].nCombo > 1 && this.m_CharaScoreList[chara_type].nCombo % Note_Mgr.Instance.SpecialCombo == 0)
  380. {
  381. Note_Mgr.Instance.SetSpecialFlag(chara_type, true);
  382. }
  383. }
  384. }
  385. public void NotMissClear()
  386. {
  387. if (!this.m_CharaScoreList.ContainsKey(DanceBattle_Mgr.CharaType.Enemy))
  388. {
  389. return;
  390. }
  391. this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].nScore += this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Enemy].nScore;
  392. }
  393. public override void StartAction()
  394. {
  395. Sprite sprite = null;
  396. if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.BenchMark)
  397. {
  398. sprite = Resources.Load<Sprite>("SceneDance/Rhythm_Action/Sprite/TrialIcon");
  399. }
  400. else
  401. {
  402. Texture2D texture2D = (!RhythmAction_Mgr.Instance.UserMaid) ? null : RhythmAction_Mgr.Instance.UserMaid.GetThumIcon();
  403. if (texture2D)
  404. {
  405. sprite = Sprite.Create(texture2D, new Rect(0f, 0f, (float)texture2D.width, (float)texture2D.height), Vector2.one * 0.5f);
  406. }
  407. }
  408. if (sprite)
  409. {
  410. this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].MaidIcon.sprite2D = sprite;
  411. this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].MaidIcon.width = this.m_IconWidth;
  412. this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].MaidIcon.height = this.m_IconHeight;
  413. }
  414. this.SetNameUI(DanceBattle_Mgr.CharaType.Player, this.m_PlayerScoreUI);
  415. if (this.m_CharaScoreList.ContainsKey(DanceBattle_Mgr.CharaType.Enemy))
  416. {
  417. this.SetNameUI(DanceBattle_Mgr.CharaType.Enemy, this.m_EnemyScoreUI);
  418. this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Enemy].MaidIcon.sprite2D = DanceBattle_Mgr.EnemyData.Icon;
  419. }
  420. }
  421. public override void EndAction()
  422. {
  423. Result_Display.SetResultData("Score", Utility.ConvertMoneyText(this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].nScore), Result_Display.ResultType.String);
  424. switch (RhythmAction_Mgr.NowDance)
  425. {
  426. case RhythmAction_Mgr.DanceType.Free:
  427. case RhythmAction_Mgr.DanceType.Challenge:
  428. Result_Display.SetResultData("Perfect", this.m_EvalueCombo[Dance_Note.Evaluation.PERFECT].ToString(), Result_Display.ResultType.String);
  429. Result_Display.SetResultData("Great", this.m_EvalueCombo[Dance_Note.Evaluation.GREAT].ToString(), Result_Display.ResultType.String);
  430. Result_Display.SetResultData("Good", this.m_EvalueCombo[Dance_Note.Evaluation.GOOD].ToString(), Result_Display.ResultType.String);
  431. Result_Display.SetResultData("Bad", this.m_EvalueCombo[Dance_Note.Evaluation.BAD].ToString(), Result_Display.ResultType.String);
  432. Result_Display.SetResultData("Miss", this.m_EvalueCombo[Dance_Note.Evaluation.MISS].ToString(), Result_Display.ResultType.String);
  433. Result_Display.SetResultData("Rate", Mathf.Floor(this.Score_Rate()).ToString(), Result_Display.ResultType.String);
  434. Result_Display.SetResultData("Combo", this.m_ComboCount.ToString(), Result_Display.ResultType.String);
  435. if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Challenge)
  436. {
  437. this.DecideReward();
  438. }
  439. break;
  440. case RhythmAction_Mgr.DanceType.VS:
  441. {
  442. RhythmAction_Mgr.DanceState nowState = RhythmAction_Mgr.NowState;
  443. if (nowState != RhythmAction_Mgr.DanceState.Dance_First)
  444. {
  445. if (nowState == RhythmAction_Mgr.DanceState.Dance_Second)
  446. {
  447. Result_Display.SetResultData("2ndScore", Utility.ConvertMoneyText(this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].nScore), Result_Display.ResultType.String);
  448. }
  449. }
  450. else
  451. {
  452. Result_Display.SetResultData("1stScore", Utility.ConvertMoneyText(this.m_CharaScoreList[DanceBattle_Mgr.CharaType.Player].nScore), Result_Display.ResultType.String);
  453. Result_Display.SetResultData("2ndScore", "NotSecond", Result_Display.ResultType.Image);
  454. }
  455. break;
  456. }
  457. }
  458. }
  459. [SerializeField]
  460. private int m_Max_Correct = 100;
  461. private const long m_Max_Score = 9999999999L;
  462. private const int m_Max_Combo = 99999;
  463. [SerializeField]
  464. private GameObject m_PlayerScoreUI;
  465. [SerializeField]
  466. private GameObject m_EnemyScoreUI;
  467. private Dictionary<DanceBattle_Mgr.CharaType, Score_Mgr.CharaScoreData> m_CharaScoreList = new Dictionary<DanceBattle_Mgr.CharaType, Score_Mgr.CharaScoreData>();
  468. [SerializeField]
  469. [Header("コンボ数に応じた文字の色")]
  470. private Score_Mgr.ComboTextColor[] m_ComboTextColor = new Score_Mgr.ComboTextColor[]
  471. {
  472. new Score_Mgr.ComboTextColor(0, Color.white),
  473. new Score_Mgr.ComboTextColor(101, Color.white),
  474. new Score_Mgr.ComboTextColor(201, Color.white),
  475. new Score_Mgr.ComboTextColor(301, Color.white),
  476. new Score_Mgr.ComboTextColor(500, Color.white)
  477. };
  478. private Dictionary<Dance_Note.Evaluation, int> m_EvalueCombo = new Dictionary<Dance_Note.Evaluation, int>
  479. {
  480. {
  481. Dance_Note.Evaluation.MISS,
  482. 0
  483. },
  484. {
  485. Dance_Note.Evaluation.BAD,
  486. 0
  487. },
  488. {
  489. Dance_Note.Evaluation.GOOD,
  490. 0
  491. },
  492. {
  493. Dance_Note.Evaluation.GREAT,
  494. 0
  495. },
  496. {
  497. Dance_Note.Evaluation.PERFECT,
  498. 0
  499. }
  500. };
  501. private List<Score_Mgr.RewardData> m_AllRewardData = new List<Score_Mgr.RewardData>();
  502. [SerializeField]
  503. [Header("各評価ごとに設定する項目")]
  504. private List<Score_Mgr.EvalueSetting> m_EvalueSetList = new List<Score_Mgr.EvalueSetting>
  505. {
  506. new Score_Mgr.EvalueSetting(Dance_Note.Evaluation.MISS, 0, 0),
  507. new Score_Mgr.EvalueSetting(Dance_Note.Evaluation.BAD, 0, 50),
  508. new Score_Mgr.EvalueSetting(Dance_Note.Evaluation.GOOD, 2, 100),
  509. new Score_Mgr.EvalueSetting(Dance_Note.Evaluation.GREAT, 3, 200),
  510. new Score_Mgr.EvalueSetting(Dance_Note.Evaluation.PERFECT, 4, 300)
  511. };
  512. private int m_NoteCount;
  513. [SerializeField]
  514. private UILabel m_ComboText;
  515. [SerializeField]
  516. private UISprite m_ComboText_Child;
  517. [SerializeField]
  518. private UILabel m_FlashCombo;
  519. [SerializeField]
  520. private UISprite m_FlashCombo_Child;
  521. [SerializeField]
  522. [Header("コンボ時の文字拡縮設定")]
  523. private float m_ScalingTime = 0.5f;
  524. [SerializeField]
  525. private float m_ScalingValue = 1.5f;
  526. private bool m_ScalingNow;
  527. [SerializeField]
  528. [Header("アイコンのサイズ")]
  529. private int m_IconWidth = 60;
  530. [SerializeField]
  531. private int m_IconHeight = 60;
  532. [SerializeField]
  533. [Header("各ボルテージごとの補正スコア")]
  534. private Score_Mgr.VoltageCorrect[] m_VoltageCorrect = new Score_Mgr.VoltageCorrect[]
  535. {
  536. new Score_Mgr.VoltageCorrect(1),
  537. new Score_Mgr.VoltageCorrect(2),
  538. new Score_Mgr.VoltageCorrect(3),
  539. new Score_Mgr.VoltageCorrect(4),
  540. new Score_Mgr.VoltageCorrect(5),
  541. new Score_Mgr.VoltageCorrect(6)
  542. };
  543. private int m_ComboCount;
  544. [SerializeField]
  545. [Header("アピール中のスコア倍率")]
  546. private int m_AppealMagnification = 3;
  547. [SerializeField]
  548. [Header("MC成功時のボーナスポイント")]
  549. private int m_McSuccesBonus = 100;
  550. [SerializeField]
  551. [Header("スコア文字拡縮")]
  552. private float m_ScoreScaling = 1.5f;
  553. [SerializeField]
  554. private float m_ScoreScalingTime = 1f;
  555. private bool m_IsExistMiss;
  556. private static Score_Mgr m_Instance;
  557. private class CharaScoreData
  558. {
  559. public long nScore;
  560. public int nCombo;
  561. public UILabel ScoreText;
  562. public UI2DSprite MaidIcon;
  563. public string CharaName;
  564. }
  565. [Serializable]
  566. private class ComboTextColor
  567. {
  568. public ComboTextColor(int combo, Color color)
  569. {
  570. this.Combo = combo;
  571. this.TextColor = color;
  572. }
  573. [Header("コンボ数")]
  574. public int Combo;
  575. [Header("文字色")]
  576. public Color TextColor;
  577. }
  578. private class RewardData
  579. {
  580. public string Rank;
  581. public string Condition;
  582. public int TargetScore;
  583. public int Reward;
  584. }
  585. [Serializable]
  586. private class EvalueSetting
  587. {
  588. public EvalueSetting(Dance_Note.Evaluation evalue, int judge, int score)
  589. {
  590. this.Evalue = evalue;
  591. this.JudgeNo = judge;
  592. this.BaceScore = score;
  593. }
  594. public Dance_Note.Evaluation Evalue;
  595. [Header("判定番号")]
  596. public int JudgeNo;
  597. [Header("基本スコア")]
  598. public int BaceScore;
  599. }
  600. [Serializable]
  601. private class VoltageCorrect
  602. {
  603. public VoltageCorrect(int voltage)
  604. {
  605. this.Voltage = voltage;
  606. }
  607. public int Voltage;
  608. public int Correct;
  609. }
  610. }