Table of Contents

Class ColorAssetCollection

Namespace
Fallencake.UI
Assembly
Fallencake.UI.dll

Adapter around an IColorAssetProvider that exposes a collection-like API for selecting and animating colors across a set of UI assets.

public class ColorAssetCollection : IColorAssetCollection<Color>, IAssetCollection<Color>
Inheritance
object
ColorAssetCollection
Implements

Constructors

ColorAssetCollection(IColorAssetProvider)

public ColorAssetCollection(IColorAssetProvider colorAssetProvider)

Parameters

colorAssetProvider IColorAssetProvider

Properties

AssetsNumber

Gets number of available color assets provided by ColorCollectionData.

public int AssetsNumber { get; }

Property Value

int

SelectedAssetIndex

Gets or sets the selected asset index, forwarding to the provider.

public int SelectedAssetIndex { get; set; }

Property Value

int

Methods

SelectAsset(int)

Selects a color by index instantly.

public void SelectAsset(int index)

Parameters

index int

Index in the collection.

SelectAsset(int, bool, float)

Selects a color by index with optional animation.

public void SelectAsset(int index, bool isInstantly = false, float duration = 1)

Parameters

index int

Index in the collection.

isInstantly bool

If true, applies immediately.

duration float

Lerp duration in seconds when not instant.

SetColor(int, bool, float)

Selects a color by index and applies it to assets, instantly or over time.

public void SetColor(int index, bool isInstantly = false, float duration = 1)

Parameters

index int

Index in the collection.

isInstantly bool

If true, applies without animation.

duration float

Lerp duration if animated.

SetColor(Color, bool, float)

Applies a specific color directly or via interpolation to all colorable assets.

public void SetColor(Color color, bool isInstantly = false, float duration = 1)

Parameters

color Color

Target color.

isInstantly bool

If true, applies without animation.

duration float

Lerp duration if animated.

SetSelectedColor()

Applies the provider's currently selected color to all assets respecting tint settings.

public void SetSelectedColor()

Events

OnAssetSelected

Raised when a color asset is selected and applied.

public event Action<Color> OnAssetSelected

Event Type

Action<Color>