A class in Root.Township, Alta.Static.
An asset for a non-networked environment piece, with its prefab and surface material. Instances are pooled and spawned by ID.
Constructors
| Member | What it is |
|---|
StaticEnvironmentPiece() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
6 private and internal fields
| Member | What it is |
|---|
private bool btnChild | Inspector button. Holds no data. |
private SurfaceMaterial material | Backing field for Material. |
private static Dictionary<uint, StaticEnvironmentPiece> pieceMap | Static cache of pieces by index, filled by Load and Spawn. |
private static Transform pooledParent | Shared do-not-destroy transform that new instances are created under. |
private StaticEnvironmentPieceInstance prefab | Backing field for Prefab. |
private Stack<StaticEnvironmentPieceInstance> stack | Pool of released instances waiting to be reused. |
Properties
Methods
| Member | What it is |
|---|
static StaticEnvironmentPiece Load(uint id) | Gets the piece with this ID, loading it from Resources/StaticEnvironmentPiece the first time. |
void SetPrefab(StaticEnvironmentPieceInstance prefab) | Editor: sets the prefab. |
StaticEnvironmentPieceInstance Spawn(Vector3 position, Quaternion rotation, Vector3 scale) | Places an instance at the given position, rotation and scale, reusing a released one if there is one. |
1 private and internal method
Used in
Members of other types that take, return or hold a StaticEnvironmentPiece:
BasicObjectDisplay.unnetworkedPrefabs, ForestGCoreInstruction.content, ForestGCoreInstruction.ForestGCoreInstruction, RiverGCoreInstruction.content, SplineInstruction.content, SplineInstruction.SplineInstruction, SpawnInstruction.content, SpawnInstruction.SpawnInstruction, StaticEnvironmentPieceInstance.CreatePiece, StaticEnvironmentPieceInstance.Initialize, StaticEnvironmentPieceInstance.piece.