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(Mesh)
Function that is called when the Graphic is populating the mesh.
Declaration
[Obsolete("Use IMeshModifier.ModifyMesh(VertexHelper verts) instead", true)]
public virtual void ModifyMesh(Mesh mesh)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | mesh | The generated mesh of the Graphic element that needs modification. |
ModifyMesh(VertexHelper)
Call used to modify mesh. Place any custom mesh processing in this function.
Declaration
public abstract void ModifyMesh(VertexHelper vh)
Parameters
| Type | Name | Description |
|---|---|---|
| VertexHelper | vh |
OnDidApplyAnimationProperties()
Called from the native side any time a animation property is changed.
Declaration
protected override void OnDidApplyAnimationProperties()
Overrides
OnDisable()
Declaration
protected override void OnDisable()
Overrides
OnEnable()
Declaration
protected override void OnEnable()
Overrides
OnValidate()
Declaration
protected override void OnValidate()