FadeableMono is an abstract MonoBehaviour base class for components that need fade in/out functionality. It provides lifecycle-based fade actions that can be configured in the Inspector.
It lives in the com.cupkekgames.fadeables package (namespace CupkekGames.Fadeables), one of Luna's bundled foundation dependencies — so it's available in any Luna project without an extra install. For fading UI Toolkit elements specifically, Luna's own FadeUIElement is the right tool; FadeableMono targets GameObjects and world objects.
The FadeableAction enum defines the possible actions that can be triggered during Unity lifecycle events:
| Value | Description |
|---|---|
| None | No action is performed |
| FadeIn | Animates the element to its visible state |
| FadeOut | Animates the element to its hidden state |
| SetFadedIn | Instantly sets the element to visible (no animation) |
| SetFadedOut | Instantly sets the element to hidden (no animation) |
FadeableMono provides four configurable fields that determine what happens at each Unity lifecycle event:
| Field | When Triggered |
|---|---|
| OnAwake | Called during Awake() |
| OnEnable | Called during OnEnable() |
| OnDisable | Called during OnDisable() |
| OnDestroy | Called during OnDestroy() |
Perfect for UI panels that should appear with animation each time they're enabled:
// Inspector settings:
// OnAwake: SetFadedOut
// OnEnable: FadeInThis configuration:
For elements that should animate out before being disabled:
// Inspector settings:
// OnDisable: FadeOutNote: The fade-out animation may not complete if the GameObject is disabled immediately. Consider using a coroutine or event-based approach for proper completion.
FadeableMono exposes its Fadeable instance publicly for additional control. Durations are public fields (_fadeInDuration / _fadeOutDuration), normally set in the Inspector:
public class MyFadeableComponent : FadeableMono
{
public void CustomFade()
{
// Access the Fadeable instance for manual control
Fadeable._fadeInDuration = 0.5f;
Fadeable.FadeIn();
}
}The fadeables package ships three ready-to-use FadeableMono subclasses:
| Class | Description | Usage |
|---|---|---|
FadeableColor | Lerps between two Inspector colors (_colorStart → _colorEnd) by the fade value | Read GetColor() (e.g. from an OnApply handler) and apply it to whatever you're tinting — it doesn't write to a Renderer itself |
FadeablePosition | Offsets the Transform from its start position by _offset × fade value | Set _offset in the Inspector — slide-in/slide-out applies automatically as the fade runs |
FadeableScale | Scales the Transform's initial localScale by the fade value | Grow/shrink applies automatically; tick _ignoreY to keep the Y axis at 1 (flatten-style hide) |
UIViewComponent uses for view fades)Settings
Theme
Light
Contrast
Material
Dark
Dim
Material Dark
System
Sidebar(Light & Contrast only)
Font Family
DM Sans
Wix
Inclusive Sans
AR One Sans
Direction