Skip to main content

SeedSprayManager

A class in Root.Township, Alta.Intelligence.

On a gotera or fern: spawns its SeedSpray as a child entity on the server and fires it on request while the creature lives.

Constructors​

MemberWhat it is
SeedSprayManager()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

3 private and internal fields
MemberWhat it is
private HealthObject healthObjectThe creature's health, checked before shooting and passed to the spray.
private NetworkPrefab prefabThe seed spray prefab to spawn.
private SeedSpray sprayThe spawned spray.

Methods​

MemberWhat it is
override void InitializeAsServer(SpawnData spawnData)Server: spawns the spray prefab under this transform (not saved), sets its shooter from the prefab root's ITargetPointer, and gives it the health object.
void Shoot()Server: fires the spray if the creature's health is above 0. Called from animation and network events on the prefab.