Class BaseMeshEffect
Base class for effects that modify the generated Mesh.
Implements
Inherited Members
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Object.GetHashCode()
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)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
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)
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
{
protected PositionAsUV1()
{}
public override void ModifyMesh(Mesh mesh)
{
if (!IsActive())
return;
var verts = mesh.vertices.ToList();
var uvs = ListPool<Vector2>.Get();
for (int i = 0; i < verts.Count; i++)
{
var vert = verts[i];
uvs.Add(new Vector2(verts[i].x, verts[i].y));
verts[i] = vert;
}
mesh.SetUVs(1, uvs);
ListPool<Vector2>.Release(uvs);
}
}
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
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()