Skip to content

Instantly share code, notes, and snippets.

@gabrielstuff
Created August 27, 2013 23:39
Show Gist options
  • Select an option

  • Save gabrielstuff/6360458 to your computer and use it in GitHub Desktop.

Select an option

Save gabrielstuff/6360458 to your computer and use it in GitHub Desktop.
Simple FadeOut
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