UIPathPlaneSpawner
Overview
Spawns a moving plane icon (a RawImage) along a sampled curve between two RectTransform anchors. Each cycle picks a random perpendicular control parameter to vary the arc, then animates at a fixed pixels-per-second with smooth ease-in-out. Supports pause, loop, and ping-pong. Icon scales up toward the middle of the path and uses a global gameScale. fileciteturn22file7
Key Fields
- Anchors:
RectTransform start,end - Curve:
curveBias,samples,resampleEveryFrame - Icon:
Texture2D planeTexture,iconSize,sizeRange,orientAlongPath - Timing:
speedPixelsPerSecond,gapSecondsRange,BoolVariable paused - Loop:
loop,pingPongfileciteturn22file7
API & Lifecycle
Refresh()to rebuild and restart.- On enable: pick random control, build path, start runner. On disable: stop and destroy spawned icon.
- Runner computes cumulative distances, moves the icon along the arc, rotates to tangent when
orientAlongPath, and scales bysin(πu)across the path. Uses unscaled realtime waits and respectspaused. fileciteturn22file7