Score_Mgr.cs 19 KB

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