RewardBubbleSpawner
Overview
Tick-driven spawner that periodically creates RewardBubbles near valid Regions. Plays an optional appear SFX and randomly selects a reward type each time.
References
- RewardBubble
bubble - BoolVariable
paused(not used for timing here, lifetime is paused inside the bubble) - SFXSingle
appearSFX
Timing
- spawnRate:
[min,max]ticks between spawns (defaults3..5). - biasK (FloatReference): biases toward higher delays;
k >= 1and bigger → more high-end bias. - Every
Tick(): increment a counter; when it reaches a target, spawn and pick a new target viaNextTimer(min,max):float u = Random.value^(1/k); return ceil(lerp(min, max, u));
Spawn Placement
- Picks a random Region that has
Presence == trueorControl >= 1. - Uses that Region’s
Node.visualAnchor.positionplus an optionaloffsetto place the bubble.
Behavior
- SpawnBubble(): plays SFX, selects a random
RewardType, and callsbubble.Spawn(type, pos).
Cleanup
OnDestroy():StopAllCoroutines()as a safety net.