Class BaseMeshEffect
Base class for effects that modify the generated Mesh.
Implements
Inherited Members
Object.MemberwiseClone()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Namespace: UnityEngine.UI
Assembly: UnityEngine.UI.dll
Syntax
[ExecuteAlways]
public abstract class BaseMeshEffect : UIBehaviour, IMeshModifier
Examples
using UnityEngine;
using UnityEngine.UI;
public class PositionAsUV1 : BaseMeshEffect
{
public override void ModifyMesh(VertexHelper vh)
{
UIVertex vert = new UIVertex();
for (int i = 0; i < vh.currentVertCount; i++)
{
vh.PopulateUIVertex(ref vert, i);
vert.uv1 = new Vector2(vert.position.x, vert.position.y);
vh.SetUIVertex(vert, i);
}
}
}
Properties
graphic
The graphic component that the Mesh Effect will aplly to.
Declaration
protected Graphic graphic { get; }
Property Value
| Type | Description |
|---|---|
| Graphic |
Methods
ModifyMesh(VertexHelper)
Called when the associated Graphic populates its mesh. Override to apply custom vertex modifications.
Declaration
public abstract void ModifyMesh(VertexHelper vh)
Parameters
| Type | Name | Description |
|---|---|---|
| VertexHelper | vh | The VertexHelper containing the mesh data to modify. |
OnDidApplyAnimationProperties()
Called from the native side any time a animation property is changed.
Declaration
protected override void OnDidApplyAnimationProperties()
Overrides
OnDisable()
Called when the component becomes disabled. Marks the associated graphic's vertices as dirty.
Declaration
protected override void OnDisable()
Overrides
OnEnable()
Called when the component becomes enabled. Marks the associated graphic's vertices as dirty.
Declaration
protected override void OnEnable()
Overrides
OnValidate()
Declaration
protected override void OnValidate()