Skip to main content

GeneratedNetworkEntityBehaviour

An abstract class in Root.Township, Alta.Networking.

Base for an entity behaviour that builds its content procedurally when it first spawns on the server, rather than loading it.

Constructors​

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

Properties​

MemberWhat it is
protected virtual bool IsGeneratingFirstTime { get; }Override to true to also generate on the first load of a chunk that isn't generating. False by default.

Methods​

MemberWhat it is
override void InitializeAsServer(SpawnData spawnData)Server: calls Generate if the spawn data says to generate (or it's the first chunk load and IsGeneratingFirstTime is set).
protected abstract void Generate(SpawnData spawnData)Builds the content. Implement in subclasses.