Table of Contents

Class ImageIndicator

Namespace
Fallencake.UI
Assembly
Fallencake.UI.dll

Represents a single indicator element with activated/deactivated states, background visibility and selection events for highlighting current step.

[Serializable]
public class ImageIndicator : MonoBehaviour
Inheritance
object
Object
Component
Behaviour
MonoBehaviour
ImageIndicator

Properties

ActivatedImage

Foreground image used when indicator is active.

public Image ActivatedImage { get; set; }

Property Value

Image

CurrentAlpha

Current alpha of the activated image.

public float CurrentAlpha { get; }

Property Value

float

DeactivatedImage

Background image used when indicator is inactive.

public Image DeactivatedImage { get; set; }

Property Value

Image

IsActive

Whether the indicator is currently active.

public bool IsActive { get; }

Property Value

bool

OnActivated

Invoked when indicator becomes active.

public UnityEvent OnActivated { get; }

Property Value

UnityEvent

OnDeactivated

Invoked when indicator becomes inactive.

public UnityEvent OnDeactivated { get; }

Property Value

UnityEvent

OnDeselected

Invoked when indicator selection is cleared.

public UnityEvent OnDeselected { get; }

Property Value

UnityEvent

OnSelected

Invoked when indicator is selected/highlighted.

public UnityEvent OnSelected { get; }

Property Value

UnityEvent

Methods

SetActive(bool)

Sets active state and updates visuals; invokes activation events on change.

public void SetActive(bool active)

Parameters

active bool

SetAlpha(float)

Sets alpha for the activated image.

public void SetAlpha(float alpha)

Parameters

alpha float

SetBackgroundVisible(bool)

Sets the visibility of the deactivated (background) image.

public void SetBackgroundVisible(bool visible)

Parameters

visible bool

SetColor(Color)

Sets color (with preserved current alpha) for the activated image.

public void SetColor(Color color)

Parameters

color Color

SetColorWithAlpha(Color, float)

Sets color with specific alpha value.

public void SetColorWithAlpha(Color color, float alpha)

Parameters

color Color
alpha float

SetState(bool, float)

Sets both the active state and alpha value at once.

public void SetState(bool active, float alpha = 1)

Parameters

active bool
alpha float

TriggerDeselected()

Triggers the OnDeselected event for this indicator.

public void TriggerDeselected()

TriggerSelected()

Triggers the OnSelected event for this indicator.

public void TriggerSelected()