Scenes_YiLiao_SaoMiaoFX.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class Scenes_YiLiao_SaoMiaoFX : MonoBehaviour
  5. {
  6. float colorRs1 = 0;
  7. float colorGs2 = 0;
  8. float colorBs3 = 0;
  9. private Color ChangeBabyToSaoMaoFXColor1(Color thisColors, bool isb, float addColorSpeed)
  10. {
  11. Color newColor;
  12. if (isb)
  13. {
  14. if (colorRs1 <= thisColors.r)
  15. {
  16. colorRs1 += Time.deltaTime * addColorSpeed;
  17. }
  18. if (colorGs2 <= thisColors.g)
  19. {
  20. colorGs2 += Time.deltaTime * addColorSpeed;
  21. }
  22. if (colorBs3 <= thisColors.b)
  23. {
  24. colorBs3 += Time.deltaTime * addColorSpeed;
  25. }
  26. newColor = new Color(colorRs1, colorGs2, colorBs3);
  27. }
  28. else
  29. {
  30. if (colorRs1 <= thisColors.r)
  31. {
  32. colorRs1 += Time.deltaTime * addColorSpeed;
  33. }
  34. if (colorGs2 <= thisColors.g)
  35. {
  36. colorGs2 += Time.deltaTime * addColorSpeed;
  37. }
  38. if (colorBs3 <= thisColors.b)
  39. {
  40. colorBs3 += Time.deltaTime * addColorSpeed;
  41. }
  42. newColor = new Color(colorRs1, colorGs2, colorBs3);
  43. }
  44. return newColor;
  45. }
  46. float colorRs11 = 0;
  47. float colorGs22 = 0;
  48. float colorBs33 = 0;
  49. private Color ChangeBabyToSaoMaoFXColor2(Color thisColors, bool isb, float addColorSpeed)
  50. {
  51. Color newColor;
  52. if (isb)
  53. {
  54. if (colorRs11 <= thisColors.r)
  55. {
  56. colorRs11 += Time.deltaTime * addColorSpeed;
  57. }
  58. if (colorGs22 <= thisColors.g)
  59. {
  60. colorGs22 += Time.deltaTime * addColorSpeed;
  61. }
  62. if (colorBs33 <= thisColors.b)
  63. {
  64. colorBs33 += Time.deltaTime * addColorSpeed;
  65. }
  66. newColor = new Color(colorRs11, colorGs22, colorBs33);
  67. }
  68. else
  69. {
  70. if (colorRs11 <= thisColors.r)
  71. {
  72. colorRs11 += Time.deltaTime * addColorSpeed;
  73. }
  74. if (colorGs22 <= thisColors.g)
  75. {
  76. colorGs22 += Time.deltaTime * addColorSpeed;
  77. }
  78. if (colorBs33 <= thisColors.b)
  79. {
  80. colorBs33 += Time.deltaTime * addColorSpeed;
  81. }
  82. newColor = new Color(colorRs11, colorGs22, colorBs33);
  83. }
  84. return newColor;
  85. }
  86. float colorRs111 = 0;
  87. float colorGs222 = 0;
  88. float colorBs333 = 0;
  89. private Color ChangeBabyToSaoMaoFXColor3(Color thisColors, bool isb, float addColorSpeed)
  90. {
  91. Color newColor;
  92. if (isb)
  93. {
  94. if (colorRs111 <= thisColors.r)
  95. {
  96. colorRs111 += Time.deltaTime * addColorSpeed;
  97. }
  98. if (colorGs222 <= thisColors.g)
  99. {
  100. colorGs222 += Time.deltaTime * addColorSpeed;
  101. }
  102. if (colorBs333 <= thisColors.b)
  103. {
  104. colorBs333 += Time.deltaTime * addColorSpeed;
  105. }
  106. newColor = new Color(colorRs111, colorGs222, colorBs333);
  107. }
  108. else
  109. {
  110. if (colorRs111 <= thisColors.r)
  111. {
  112. colorRs111 += Time.deltaTime * addColorSpeed;
  113. }
  114. if (colorGs222 <= thisColors.g)
  115. {
  116. colorGs222 += Time.deltaTime * addColorSpeed;
  117. }
  118. if (colorBs333 <= thisColors.b)
  119. {
  120. colorBs333 += Time.deltaTime * addColorSpeed;
  121. }
  122. newColor = new Color(colorRs111, colorGs222, colorBs333);
  123. }
  124. return newColor;
  125. }
  126. }