Skip to main content

SpawnInstruction

A class in Root.Township, Alta.Static.

Static environment instruction that places one StaticEnvironmentPiece at a position, rotation and scale.

Constructors​

MemberWhat it is
SpawnInstruction()Creates a SpawnInstruction from content, position, rotation and scale.
SpawnInstruction(StaticEnvironmentPiece content, Vector3 position, Quaternion rotation, Vector3 scale)Creates a SpawnInstruction from content, position, rotation and scale.

Fields​

5 private and internal fields
MemberWhat it is
private StaticEnvironmentPiece contentThe piece to spawn, loaded from contentId when needed.
private uint contentIdIndex of the piece.
private Vector3 positionWhere to spawn the piece.
private Quaternion rotationThe piece's rotation.
private Vector3 scaleThe piece's scale.

Methods​

MemberWhat it is
override IInstructionResult Execute(object context)Loads the piece by its index if needed and spawns it. Logs an error and returns null if the piece is missing.
protected override void SerializeInternal(Stream stream)Reads or writes the piece index, position, rotation and scale, and drops the cached piece.