Spawn & Wave System

v1.0.0

Component Reference

Complete API reference for all SWS components and ScriptableObjects.

Overview

This reference documents all SWS components including their properties, methods, and events. Use this as your API documentation when implementing spawning systems.

Note: All components integrate seamlessly with Game Creator 2 visual scripting. No C# coding required for basic usage.
Core

Essential components

Singleton

Single instance only

ScriptableObject

Data assets

Scene Component

Scene-based

SpawnManager

CoreSingleton

Central manager for all spawn operations. Handles the spawn queue, object pooling, and entity registry.

Properties

PropertyTypeDescription
SettingsSpawnManagerSettingsConfiguration asset for global settings
Pool ParentTransformParent object for pooled entities
Auto Create Pool ParentboolCreate pool parent if not assigned

Methods

MethodDescription
QueueSpawn(SpawnRequest)Adds a spawn request to the priority queue
Spawn(SpawnProfile, Vector3, Quaternion)Immediately spawns an entity
DespawnAll()Returns all active entities to pool
GetSpawnPoint(string tag)Gets a spawn point by tag
GetSpawnPoints(string[] tags)Gets spawn points matching tags

Events

EventDescription
OnEntitySpawnedFired when an entity is spawned
OnEntityDespawnedFired when an entity is returned to pool

WaveController

CoreScene Component

Orchestrates wave sequences including starting, pausing, resuming, and skipping waves.

Properties

PropertyTypeDescription
Wave SequenceWaveSequenceThe sequence to play
Auto StartboolStart sequence on scene load
Auto AdvanceboolAutomatically start next wave
Wave DelayfloatDelay between waves (seconds)

Methods

MethodDescription
StartSequence()Begins the wave sequence
StartWave(int index)Starts a specific wave
PauseWave()Pauses current wave spawning
ResumeWave()Resumes paused wave
SkipWave()Skips to the next wave
StopSequence()Stops the entire sequence

Events

EventDescription
OnWaveStartedFired when a wave begins
OnWaveCompletedFired when a wave ends
OnSequenceCompletedFired when all waves complete
OnSpawningCompleteFired when all entities for a wave have spawned

SpawnPoint

Scene Component

Marks a valid spawn location in the scene with optional constraints and path references.

Properties

PropertyTypeDescription
Tagsstring[]Tags for filtering spawn points
Spawn RadiusfloatRandom offset radius from center
Max ConcurrentintMaximum active entities from this point
CooldownfloatMinimum time between spawns
Path AnchorPathAnchorDefault path for spawned entities
Spawn OffsetVector3Position offset from transform

Methods

MethodDescription
CanSpawn()Returns true if spawn point is available
GetSpawnPosition()Gets a position within the spawn radius
RegisterSpawn()Marks a spawn as occurring

SpawnProfile

ScriptableObject

Defines what to spawn including prefab, variants, pooling settings, and budget cost.

Properties

PropertyTypeDescription
Profile IDstringUnique identifier (auto-generated)
Display NamestringName for editor and UI
IconSpriteIcon for editor and UI
TypeSpawnableTypeCharacter, Projectile, Resource, etc.
PrefabGameObjectPrimary prefab to spawn
VariantsPrefabVariant[]Weighted prefab alternatives
Budget CostintCost for wave budget balancing
LifetimefloatAuto-despawn time (0 = infinite)
Random Y RotationboolSpawn with random rotation
Spawn OffsetVector3Position offset from spawn point
Use PoolingboolEnable object pooling
Pool SizeintInitial pool size
Allow GrowthboolCreate more if pool is empty

WaveDefinition

ScriptableObject

Defines a single wave including what to spawn, timing, and completion conditions.

Properties

PropertyTypeDescription
Wave IDstringUnique identifier (auto-generated)
Display NamestringName for UI and debugging
DescriptionstringOptional description
AllocationsSpawnAllocation[]Profiles with spawn counts
BudgetintTotal budget (0 = use allocations directly)
Spawn Point SelectionSpawnPointSelectionRandom, RoundRobin, Tagged
Spawn Point Tagsstring[]Filter spawn points by tags
Spawn IntervalfloatTime between spawns
Random IntervalboolRandomize spawn timing
End ConditionWaveEndConditionWhen wave is complete
Time LimitfloatDuration for Timer end condition

WaveSequence

ScriptableObject

Groups wave definitions into a playable sequence with mode and timing settings.

Properties

PropertyTypeDescription
Sequence IDstringUnique identifier (auto-generated)
Display NamestringName for UI and debugging
WavesWaveDefinition[]Array of wave definitions
ModeSequenceModeSingle, Loop, or Endless
Auto AdvanceboolAutomatically start next wave
Wave DelayfloatDelay between waves
Scale On LoopboolIncrease difficulty each loop
Spawn MultiplierfloatSpawn count multiplier per loop
Stat MultiplierfloatStat multiplier per loop

SpawnedEntityTracker

Scene Component

Tracks entity lifecycle, health status, and handles defeat/despawn logic.

Properties

PropertyTypeDescription
ProfileSpawnProfileSource profile (set on spawn)
Wave IndexintWave this entity belongs to
Is AliveboolCurrent alive status
Defeat ReasonDefeatReasonWhy entity was defeated
Use Stats HealthboolIntegrate with GC2 Stats
Health AttributestringGC2 Stats attribute name

Methods

MethodDescription
Defeat(DefeatReason)Marks entity as defeated
Despawn()Returns entity to pool
ResetTracker()Resets for pool reuse

Events

EventDescription
OnDefeatedFired when entity is defeated
OnDespawnedFired when entity returns to pool

PathAnchor

Scene Component

Waypoint node for path-based movement. Supports branching and wait times.

Properties

PropertyTypeDescription
Next AnchorsPathAnchor[]Connected waypoints
Selection ModeNextAnchorSelectionFirst, Random, Weighted
Wait TimefloatPause at this waypoint
Speed MultiplierfloatSpeed modifier for next segment
Reach RadiusfloatDistance to consider reached

Methods

MethodDescription
GetNextAnchor()Returns the next anchor based on selection mode
HasNext()Returns true if more anchors exist

PathFollower

Scene Component

Makes entities follow path anchors with configurable movement settings.

Properties

PropertyTypeDescription
Movement SpeedfloatBase movement speed
Rotation SpeedfloatTurn speed toward target
Smooth MovementboolInterpolate for smoother motion
Look AheadboolRotate toward next waypoint early
Is ActiveboolCurrently following path
Current Path IndexintCurrent waypoint index

Methods

MethodDescription
Initialize(PathAnchor)Sets starting anchor
SetPath(PathAnchor)Changes current path
StartFollowing()Begins path movement
StopFollowing()Stops path movement
Pause()Pauses movement
Resume()Resumes movement

Events

EventDescription
OnPathCompletedFired when reaching path end
OnWaypointReachedFired at each waypoint
OnBlockedFired when obstacle detected

UI Components

SWS includes optional UI components for displaying wave status:

WaveStatusUI

Displays current wave number, progress, and alive/defeated counts.

WaveAnnouncerUI

Shows wave start/complete announcements with fade animations.

EntityCountUI

Simple counter showing remaining entities.

NextWaveTimerUI

Countdown timer between waves.