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
-
objectObjectComponentBehaviourMonoBehaviourImageIndicator
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
activebool
SetAlpha(float)
Sets alpha for the activated image.
public void SetAlpha(float alpha)
Parameters
alphafloat
SetBackgroundVisible(bool)
Sets the visibility of the deactivated (background) image.
public void SetBackgroundVisible(bool visible)
Parameters
visiblebool
SetColor(Color)
Sets color (with preserved current alpha) for the activated image.
public void SetColor(Color color)
Parameters
colorColor
SetColorWithAlpha(Color, float)
Sets color with specific alpha value.
public void SetColorWithAlpha(Color color, float alpha)
Parameters
colorColoralphafloat
SetState(bool, float)
Sets both the active state and alpha value at once.
public void SetState(bool active, float alpha = 1)
Parameters
activeboolalphafloat
TriggerDeselected()
Triggers the OnDeselected event for this indicator.
public void TriggerDeselected()
TriggerSelected()
Triggers the OnSelected event for this indicator.
public void TriggerSelected()