Show / Hide Table of Contents

Class SpriteFader

Used to fade a sprite from one color to another

Inheritance
object
Object
Component
Behaviour
MonoBehaviour
SpriteFader
Namespace: WeaverCore.Components
Assembly: WeaverCore.dll
Syntax
public class SpriteFader : MonoBehaviour

Fields

| Edit this page View Source

DoneBehaviour

Declaration
[Tooltip("What should this script do when done fading?")]
public OnDoneBehaviour DoneBehaviour
Field Value
Type Description
OnDoneBehaviour
| Edit this page View Source

Duration

Declaration
[Tooltip("How long it should take to fade from one color to another")]
public float Duration
Field Value
Type Description
float
| Edit this page View Source

FadeOnStart

Declaration
[Tooltip("Should this script start fading upon Awake?")]
public bool FadeOnStart
Field Value
Type Description
bool

Properties

| Edit this page View Source

FromColor

The color to fade from

Declaration
public Color FromColor { get; set; }
Property Value
Type Description
Color
| Edit this page View Source

Renderer

Declaration
public SpriteRenderer Renderer { get; set; }
Property Value
Type Description
SpriteRenderer
| Edit this page View Source

ToColor

The color to fade to

Declaration
public Color ToColor { get; set; }
Property Value
Type Description
Color

Methods

| Edit this page View Source

FadeToColor(Color, float)

Fades the sprite into a new color

Declaration
public void FadeToColor(Color toColor, float duration = -1)
Parameters
Type Name Description
Color toColor

The color to fade to

float duration

How long to should it take to fade? If set to -1, it will use the default Duration specified on the component

| Edit this page View Source

FadeToColor(Color, Color, float)

Fades the sprite from an old color to a new one

Declaration
public void FadeToColor(Color fromColor, Color toColor, float duration = -1)
Parameters
Type Name Description
Color fromColor

The color to fade from

Color toColor

The color to fade to

float duration

How long to should it take to fade? If set to -1, it will use the default Duration specified on the component

| Edit this page View Source

FadeToTransparency(float)

Fades the sprite into transparency

Declaration
public void FadeToTransparency(float duration = -1)
Parameters
Type Name Description
float duration

How long to should it take to fade? If set to -1, it will use the default Duration specified on the component

| Edit this page View Source

FadeToTransparency(Color, float)

Fades from a color to transparency

Declaration
public void FadeToTransparency(Color fromColor, float duration = -1)
Parameters
Type Name Description
Color fromColor

The color to fade from

float duration

How long to should it take to fade? If set to -1, it will use the default Duration specified on the component

Extension Methods

ReflectionUtilities.ReflectCallMethod(object, string, object[], BindingFlags)
ReflectionUtilities.ReflectGetField(object, string, BindingFlags)
ReflectionUtilities.ReflectGetMethod(object, string, BindingFlags)
ReflectionUtilities.ReflectGetProperty(object, string, BindingFlags)
ReflectionUtilities.ReflectSetField(object, string, object, BindingFlags)
ReflectionUtilities.ReflectSetProperty(object, string, object, BindingFlags)
CoroutineUtilities.RunCoroutineWhile<T>(T, IEnumerator, Func<bool>)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾