Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private IEnumerator ImageFadeInOut(Image image, float fadeTime)
- {
- yield return new WaitForSeconds(fadeTime);
- float thisTimer4 = 0;
- float adder4 = .01f;
- Color newColor4 = image.GetComponent<Image>().color;
- while (thisTimer4 < fadeTime)
- {
- thisTimer4 = thisTimer4 + .01f;
- yield return new WaitForSeconds(.01f);
- if (thisTimer4 > fadeTime / 2)
- {
- adder4 = -.01f;
- }
- newColor4.a += adder4;
- image.GetComponent<Image>().color = newColor4;
- }
- image.gameObject.SetActive(false);
- }
- private IEnumerator FadeInOut(Text text5)
- {
- float thisTimer5 = 0;
- float adder5 = .01f;
- Color newColor5 = text5.color;
- while (thisTimer5 < 3)
- {
- thisTimer5 = thisTimer5 + .01f;
- yield return new WaitForSeconds(.01f);
- if (thisTimer5 > 1.5 && adder5 > 0)
- {
- adder5 = adder5 * (-1);
- }
- newColor5.a += adder5;
- text5.color = newColor5;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement