Skip to main content

PooledMeshReplaceObjectDefinition

A class in Root.Township, the global namespace.

Pooled object definition whose instances are MeshReplacePooledObjects given a set mesh and material when requested.

Constructors​

MemberWhat it is
PooledMeshReplaceObjectDefinition()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

3 private and internal fields
MemberWhat it is
private const string AssetPathFormatPath pattern for these assets in the Unity project.
private Material materialMaterial given to each instance.
private Mesh meshMesh given to each instance.

Methods​

MemberWhat it is
bool Bake(IEnumerable<AtlasDefinition> atlasDefinitions)Applies the first matching atlas to the mesh and material and stores the baked result. Returns false if none match.
override PooledObject Get(Vector3 position, Quaternion rotation)Gets a pooled object and gives it this mesh and material. Logs an error if the prefab isn't a mesh replace object.
static PooledMeshReplaceObjectDefinition GetOrCreate(string name, out bool wasCreated)Stub in this build: always returns null.