FreeResult.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class FreeResult : Result_Display
  6. {
  7. private void Awake()
  8. {
  9. base.Initialize();
  10. base.StartCoroutine(this.ScoreFadeIn());
  11. }
  12. protected override void Update()
  13. {
  14. base.Update();
  15. }
  16. protected override void UIInit(Transform child)
  17. {
  18. UISprite component = child.GetComponent<UISprite>();
  19. Vector3 localPosition = child.localPosition;
  20. localPosition.x = UI_ScreenFitBase.PointToScreenPos(Vector3.right * (float)UICamera.ScreenWidth).x;
  21. if (component)
  22. {
  23. localPosition.x += (float)(component.width / 2);
  24. }
  25. if (this.m_ScoreResultUI != child)
  26. {
  27. this.m_RateResultGroup.Add(child);
  28. this.m_GroupEnd.Add(child.localPosition);
  29. this.m_GroupStart.Add(localPosition);
  30. }
  31. else
  32. {
  33. this.m_ScoreUIStart = localPosition;
  34. this.m_ScoreUIEnd = child.localPosition;
  35. }
  36. child.localPosition = localPosition;
  37. }
  38. private IEnumerator ScoreFadeIn()
  39. {
  40. while (GameMain.Instance.MainCamera.IsFadeOut())
  41. {
  42. yield return null;
  43. }
  44. float timer = 0f;
  45. GameMain.Instance.SoundMgr.PlaySe(this.m_SlideSEName, false);
  46. for (;;)
  47. {
  48. timer += base.m_MydeltaTime;
  49. this.m_ScoreResultUI.localPosition = Vector3.Lerp(this.m_ScoreUIStart, this.m_ScoreUIEnd, base.SinRate01(timer, this.m_ScoreUISlide));
  50. if (timer > this.m_ScoreUISlide)
  51. {
  52. break;
  53. }
  54. yield return null;
  55. }
  56. yield return new WaitForSeconds(this.m_ScoreUIRug / (float)this.m_TimeSpeed);
  57. base.StartCoroutine(this.OtherResultFadeIn());
  58. yield break;
  59. yield break;
  60. }
  61. private IEnumerator OtherResultFadeIn()
  62. {
  63. float timer = 0f;
  64. int count = 0;
  65. GameMain.Instance.SoundMgr.PlaySe(this.m_SlideSEName, false);
  66. for (;;)
  67. {
  68. timer += base.m_MydeltaTime;
  69. this.m_RateResultGroup[count].localPosition = Vector3.Lerp(this.m_GroupStart[count], this.m_GroupEnd[count], base.SinRate01(timer, this.m_OtherUISlide));
  70. if (timer > this.m_OtherUISlide)
  71. {
  72. count++;
  73. timer = 0f;
  74. yield return new WaitForSeconds(this.m_OtherUIRug / (float)this.m_TimeSpeed);
  75. if (count == this.m_RateResultGroup.Count)
  76. {
  77. break;
  78. }
  79. GameMain.Instance.SoundMgr.PlaySe(this.m_SlideSEName, false);
  80. }
  81. yield return null;
  82. }
  83. this.m_ButtonUI.SetActive(true);
  84. yield break;
  85. yield break;
  86. }
  87. [SerializeField]
  88. [Header("スコア表示UI表示後の待機時間")]
  89. private float m_ScoreUIRug = 0.25f;
  90. [SerializeField]
  91. [Header("スコア表示UIのスライド時間")]
  92. private float m_ScoreUISlide = 0.5f;
  93. [SerializeField]
  94. [Header("他のUI表示後の待機時間")]
  95. private float m_OtherUIRug = 0.0625f;
  96. [SerializeField]
  97. [Header("他のUIのスライド時間")]
  98. private float m_OtherUISlide = 0.15f;
  99. [SerializeField]
  100. [Header("スコア表示UI")]
  101. private Transform m_ScoreResultUI;
  102. private Vector3 m_ScoreUIStart;
  103. private Vector3 m_ScoreUIEnd;
  104. private List<Transform> m_RateResultGroup = new List<Transform>();
  105. }