Visual FX & Utilities
Drop-in components for breathing animations, hover effects, procedural backgrounds, UI state control during play, pixel snapping, and depth sorting. Each is self-contained — just add the component and set the Inspector fields.
Breathing / pulsing animations
Two components produce a sine-wave breathing animation on different target types:
- SpriteExpandAnimation — attach to any world-space sprite. Animates the
SpriteRenderersize. Setspeed,amplitude, and thehorizontal/verticalcontribution sliders (0–1). - SinExpandAnimation — attach to any UI element. Animates the
RectTransform.sizeDelta. Same fields as above. The timer resets onOnEnable, keeping groups in sync when you toggle panels.
See Visual FX.
Hover scale effect (HoveringMouse)
Add HoveringMouse to any UI element to scale it up when hovered.
- Set Max Size (target scale) and Speed (lerp rate).
- Optionally assign an
AudioSourceand Enter Sound / Exit Sound clips. - Enable Mute On Running to silence hover sounds while instructions execute.
- If the same GameObject has a
Button, the effect is suppressed automatically when the button is not interactable.
See Visual FX.
Decorative clouds (CloudsController)
Add CloudsController to a scene GameObject to fill a rectangular area with drifting cloud sprites.
- Set Area Size to the width and height of the drift zone.
- Assign Prefabs — a list of cloud prefabs chosen at random.
- Set Min Speed / Max Speed for random per-cloud drift rates.
- Set Amount for the total number of clouds.
The cloud area is shown as a cyan wire cube in the Scene view. See Visual FX.
Disabling UI during play
Two components automatically lock UI elements while the instruction runner is active:
- DisableOnRunning — requires a
CanvasGroup. Dims to 50% opacity and blocks interaction during play; restores on stop. Use for entire panels or groups of controls. - DisableButtonOnRunning — requires a
Button. Only disables interactability, no visual dimming. Use for individual buttons where you control the visual state separately.
Both subscribe to LevelManager.OnPlay and LevelManager.OnStop automatically in Start. No wiring is needed. See Utilities.
Pixel snapping (PixelSnaper)
Add PixelSnaper to any GameObject that drifts off pixel boundaries.
- Set Pixels Per Unit to match the sprite import setting (16 or 32 are common).
- Enable Snap To Grid and set Cell Size if you want objects locked to tile centers instead of individual pixels.
The component runs in Edit mode ([ExecuteInEditMode]) so you can verify snapping while placing objects in the Scene view. See Utilities.
Y-based depth sorting (DepthSortingOrder)
Add DepthSortingOrder to any sprite that needs painter's-algorithm depth in a top-down or isometric layout.
- Assign Top Limit — a Transform placed at the topmost row of the level. Objects near the top are drawn behind objects lower on screen.
The component updates SpriteRenderer.sortingOrder every frame based on the object's Y position relative to the limit. See Utilities.