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. fileciteturn22file7

Key Fields

  • Anchors: RectTransform start, end
  • Curve: curveBias, samples, resampleEveryFrame
  • Icon: Texture2D planeTexture, iconSize, sizeRange, orientAlongPath
  • Timing: speedPixelsPerSecond, gapSecondsRange, BoolVariable paused
  • Loop: loop, pingPong fileciteturn22file7

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 by sin(πu) across the path. Uses unscaled realtime waits and respects paused. fileciteturn22file7