Skip to main content

PositionedPrefab<T>

An abstract class in Root.Township, the global namespace.

Serializable base for a saved prefab reference with a local position and rotation, which subclasses spawn back under a parent in a chunk.

Constructors​

MemberWhat it is
protected PositionedPrefab()Creates a PositionedPrefab with default values.

Fields​

MemberWhat it is
protected Vector3 positionSaved local position.
protected Quaternion rotationSaved local rotation.

Methods​

MemberWhat it is
abstract T Load(Transform transformParent, Chunk chunk)Spawns the prefab under a parent in a chunk.
virtual void Save(T scenePrefab)Stores the instance's local position and rotation.
protected abstract Transform GetTransform(T scenePrefab)Returns the transform of a spawned instance.