Skip to main content

GrassBlade

A class in Root.Township, Alta.Environmental.Vegetation.

A single grass blade object, with a mesh built from a GrassBladeMesh asset.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private GrassBladeMesh bladeMeshBacking field for Mesh.
private MeshFilter filterCached MeshFilter for Filter.

Properties​

MemberWhat it is
MeshFilter Filter { get; }The blade's MeshFilter, fetched on first use.
GrassBladeMesh Mesh { get; }The GrassBladeMesh asset this blade uses.

Methods​

MemberWhat it is
List<Vector3> GetLocalVertices()Returns the blade's vertices offset by its local position and rotated back by its rotation.
void Initialize(GrassBladeMesh mesh, Material grassMaterial, bool hasThickening)Builds the blade's mesh from the asset, with UVs and vertex colours for height and thickening, and sets the material with shadows off.

Used in​

Members of other types that take, return or hold a GrassBlade: