Class GFoliage
Contains information about a terrain foliage prototypes, instances, snapping mode, etc. This should not be used alone without a parent terrain data. In most cases you don't instantiate it with ScriptableObject.Create(). The correct way is to accessing it with GTerrainData.Foliage.
public class GFoliage : ScriptableObject, ISerializationCallbackReceiver
- Inheritance
-
ObjectScriptableObjectGFoliage
- Implements
-
ISerializationCallbackReceiver
- Inherited Members
-
ScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetInstanceID()Object.GetHashCode()Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Properties
- BendSensitive
How fast grass bend when a GInteractiveGrassAgent object is nearby.
- EnableInteractiveGrass
Turn this on if you want grass to react to a game object with GInteractiveGrassAgent component attached.
- GrassInstanceCount
Get the total number of grass instances.
- GrassPatches
Direct reference to the grass patches array, which contains grass instances within an area.
- GrassSnapLayerMask
Collider layers to use when grass snapping mode set to World.
- GrassSnapMode
The behavior when performing snapping grass onto surface below.
- Grasses
The grass prototype group assigned to this.
- PatchGridSize
The terrain divides grass to several patches. This value determine size of the patch grid. Ex: PatchGridSize = 16 -> 16x16=256 patches.
- RestoreSensitive
How fast grass restore to their original orientation when a GInteractiveGrassAgent goes away.
- TerrainData
The parent terrain data this object belongs to.
- TreeInstances
Direct reference to the tree instances list. Don't add tree to this list directly, use AddTreeInstances() instead.
- TreeSnapLayerMask
Collider layers to use when tree snapping mode set to World.
- TreeSnapMode
The behavior when perform snapping tree onto surface below.
- Trees
The tree prototype group assigned to this.
- VectorFieldMapResolution
Size of the texture used for interactive grass.
Methods
- AddGrassInstances(List<GGrassInstance>)
Add some grass instances to the terrain and refresh the renderer.
- AddTreeInstances(IEnumerable<GTreeInstance>)
Add some tree instances to this terrain.
- ClearGrassDirtyRegions()
Clear all regions marked with SetGrassDirtyRegions(). Call this function when you've done grass snapping action or similar.
- ClearGrassInstances()
Erase all grass instances from the terrain.
- ClearTreeDirtyRegions()
Clear all regions marked with SetTreeDirtyRegions(). Call this function when you've done tree snapping action or similar.
- ClearTreeInstances()
Erase all tree instances from this terrain.
- CopyTo(GFoliage)
Copy numeric value to other object. This doesn't copy tree and grass instances.
- GetGrassDirtyRegions()
Get a collection of regions where grass have been modified. Region value in [0-1] range.
- GetGrassInstances()
Get a copy of all grass instances in this terrain. Very slow!
- GetTreeDirtyRegions()
Get a collection of regions where trees have been modified. Region value in [0-1] range.
- GrassAllChanged()
Call this function to invoke an event and refresh grass renderer when you've modify some grass instances.
- RemoveTreeInstances(Predicate<GTreeInstance>)
Erase tree instances that match a condition.
- SetGrassRegionDirty(Rect)
Mark all grass in this region as modified to perform related actions such as grass snapping. You should call this function after modifying the grass list or terrain geometry.
- SetTreeRegionDirty(Rect)
Mark all tree in this region as modified to perform related actions such as tree snapping. You should call this function after modifying the tree list or terrain geometry.
- TreeAllChanged()
Call this function to invoke an event and refresh tree renderer when you've modify some tree instances.