public void DoFade() { if(!isFading) { isFading = true; blackFadeOverlay.AddEventListener(this.gameObject); blackFadeOverlay.FadeInto(Color.black, 120); } }
public virtual void OnStart() { originalColor = spriteToUse.color; fadeComponent = this.GetComponent <Fading2D>(); fadeComponent.SetTarget(spriteToUse); fadeComponent.AddEventListener(this.gameObject); if (!isInitialized) { clouds = new List <Cloud>(this.GetComponentsInChildren <Cloud>()); isInitialized = true; } Before(); }
// Use this for initialization void Start() { fadeOverlay.AddEventListener(this.gameObject); Invoke("StartFading", quitGameTimeout); }
public override void OnActivated() { fadingSprite.GetComponent <SpriteRenderer>().enabled = true; fadingSprite.FadeInto(colorToFadeInto, fadeOutTime, FadeType.DEFAULT); fadingSprite.AddEventListener(this.gameObject); }