v3.6.1 Documentation
Fungus.SpriteFader Class Reference

Transitions a sprite from its current color to a target color. More...

Inheritance diagram for Fungus.SpriteFader:

Static Public Member Functions

static void FadeSprite (SpriteRenderer spriteRenderer, Color targetColor, float duration, Vector2 slideOffset, Action onComplete=null)
 Attaches a SpriteFader component to a sprite object to transition its color over time. More...
 

Protected Member Functions

virtual void Start ()
 
virtual void Update ()
 

Protected Attributes

float fadeDuration
 
float fadeTimer
 
Color startColor
 
Color endColor
 
Vector2 slideOffset
 
Vector3 endPosition
 
SpriteRenderer spriteRenderer
 
Action onFadeComplete
 

Detailed Description

Transitions a sprite from its current color to a target color.

An offset can be applied to slide the sprite in while changing color.

Definition at line 14 of file SpriteFader.cs.

Member Function Documentation

◆ FadeSprite()

static void Fungus.SpriteFader.FadeSprite ( SpriteRenderer  spriteRenderer,
Color  targetColor,
float  duration,
Vector2  slideOffset,
Action  onComplete = null 
)
static

Attaches a SpriteFader component to a sprite object to transition its color over time.

Definition at line 71 of file SpriteFader.cs.

◆ Start()

virtual void Fungus.SpriteFader.Start ( )
protectedvirtual

Definition at line 27 of file SpriteFader.cs.

◆ Update()

virtual void Fungus.SpriteFader.Update ( )
protectedvirtual

Definition at line 32 of file SpriteFader.cs.

Member Data Documentation

◆ endColor

Color Fungus.SpriteFader.endColor
protected

Definition at line 19 of file SpriteFader.cs.

◆ endPosition

Vector3 Fungus.SpriteFader.endPosition
protected

Definition at line 21 of file SpriteFader.cs.

◆ fadeDuration

float Fungus.SpriteFader.fadeDuration
protected

Definition at line 16 of file SpriteFader.cs.

◆ fadeTimer

float Fungus.SpriteFader.fadeTimer
protected

Definition at line 17 of file SpriteFader.cs.

◆ onFadeComplete

Action Fungus.SpriteFader.onFadeComplete
protected

Definition at line 25 of file SpriteFader.cs.

◆ slideOffset

Vector2 Fungus.SpriteFader.slideOffset
protected

Definition at line 20 of file SpriteFader.cs.

◆ spriteRenderer

SpriteRenderer Fungus.SpriteFader.spriteRenderer
protected

Definition at line 23 of file SpriteFader.cs.

◆ startColor

Color Fungus.SpriteFader.startColor
protected

Definition at line 18 of file SpriteFader.cs.


The documentation for this class was generated from the following file: