Created
August 27, 2013 23:39
-
-
Save gabrielstuff/6360458 to your computer and use it in GitHub Desktop.
Simple FadeOut
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void fadeOut(float duration, float delay){ | |
| _duration = duration; | |
| _delay = delay; | |
| Color colorTo = renderer.material.color; | |
| colorTo.a = 0; | |
| foreach (Material mat in renderer.materials) | |
| { | |
| HOTween.To(mat, duration, new TweenParms() | |
| .Prop("color", colorTo) | |
| .Ease(EaseType.EaseInOutQuad) // Ease | |
| .OnUpdate( OnTweenUpdate ) | |
| .Delay(delay) | |
| ); | |
| fadeGlow(duration, 0, delay); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment