Visual FX
Four drop-in visual effect components: two sine-wave breathing animations (one for sprites, one for UI rect transforms), a hover scale effect for UI buttons, and a procedural drifting-clouds generator.
SpriteExpandAnimation
Continuously animates a SpriteRenderer's size using a sine wave, producing a breathing or pulsing effect. Attach to any world-space sprite.
Inspector Fields
| Field | Type | Description |
|---|---|---|
speed | float | Frequency of the oscillation in cycles per second. |
amplitude | float | Maximum size change in world units. Default: 1. |
horizontal | float [0–1] | Horizontal contribution to the expansion. Set to 0 to animate only vertically. |
vertical | float [0–1] | Vertical contribution to the expansion. Set to 0 to animate only horizontally. |
SinExpandAnimation
Same sine-wave breathing effect as SpriteExpandAnimation, but targets a RectTransform's sizeDelta for use in UI canvases. The animation timer resets each time the component is enabled, keeping synchronized groups in phase.
Inspector Fields
| Field | Type | Description |
|---|---|---|
speed | float | Frequency of the oscillation in cycles per second. |
amplitude | float | Maximum size change in pixels. Default: 1. |
horizontal | float [0–1] | Horizontal contribution to the size change. |
vertical | float [0–1] | Vertical contribution to the size change. |
HoveringMouse
Scales a UI element up when the pointer hovers over it and back down when it leaves, with optional audio feedback. Implements IPointerEnterHandler and IPointerExitHandler. Automatically suppresses the effect if a sibling Button is not interactable.
Inspector Fields
| Field | Type | Description |
|---|---|---|
maxSize | float | The local scale the element grows to when hovered. Default: 2. |
speed | float | Lerp speed for the scale transition in and out. Default: 1. |
audioSource | AudioSource | Audio source used to play hover sounds. |
muteOnRunning | bool | When enabled, suppresses hover sounds while instructions are executing. |
enterSound | AudioClip | Played when the pointer enters the element. |
exitSound | AudioClip | Played when the pointer leaves the element. |
volume | float [0–1] | Volume multiplier for both hover sounds. Default: 1. |
CloudsController
Procedurally spawns and drifts a set of decorative cloud GameObjects within a rectangular area. Clouds that exit the right edge wrap back to the left at a random vertical position. Draws its bounding area as a cyan wire cube in the Scene view.
Inspector Fields
| Field | Type | Description |
|---|---|---|
areaSize | Vector2 | Width and height of the rectangular cloud spawn and drift area. |
prefabs | GameObject[] | Pool of cloud prefabs chosen at random when a new cloud is spawned. |
minSpeed | float | Minimum drift speed in world units per second. |
maxSpeed | float | Maximum drift speed in world units per second. |
amount | int | Total number of cloud instances to create and simulate. |