A class in Root.Township, Alta.Environmental.Vegetation.
A single grass blade object, with a mesh built from a GrassBladeMesh asset.
Constructors
| Member | What it is |
|---|
GrassBlade() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
2 private and internal fields
| Member | What it is |
|---|
private GrassBladeMesh bladeMesh | Backing field for Mesh. |
private MeshFilter filter | Cached MeshFilter for Filter. |
Properties
| Member | What it is |
|---|
MeshFilter Filter { get; } | The blade's MeshFilter, fetched on first use. |
GrassBladeMesh Mesh { get; } | The GrassBladeMesh asset this blade uses. |
Methods
| Member | What 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: