forked from hunterzonewu/unity-decompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseMeshEffect.cs
More file actions
79 lines (70 loc) · 2.2 KB
/
BaseMeshEffect.cs
File metadata and controls
79 lines (70 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Decompiled with JetBrains decompiler
// Type: UnityEngine.UI.BaseMeshEffect
// Assembly: UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 2216A18B-AF52-44A5-85A0-A1CAA19C1090
// Assembly location: C:\Users\Blake\sandbox\unity\test-project\Library\UnityAssemblies\UnityEngine.UI.dll
using System;
using UnityEngine.EventSystems;
namespace UnityEngine.UI
{
/// <summary>
/// <para>Base class for effects that modify the generated Mesh.</para>
/// </summary>
[ExecuteInEditMode]
public abstract class BaseMeshEffect : UIBehaviour, IMeshModifier
{
[NonSerialized]
private Graphic m_Graphic;
protected Graphic graphic
{
get
{
if ((UnityEngine.Object) this.m_Graphic == (UnityEngine.Object) null)
this.m_Graphic = this.GetComponent<Graphic>();
return this.m_Graphic;
}
}
protected override void OnEnable()
{
base.OnEnable();
if (!((UnityEngine.Object) this.graphic != (UnityEngine.Object) null))
return;
this.graphic.SetVerticesDirty();
}
/// <summary>
/// <para>See MonoBehaviour.OnDisable.</para>
/// </summary>
protected override void OnDisable()
{
if ((UnityEngine.Object) this.graphic != (UnityEngine.Object) null)
this.graphic.SetVerticesDirty();
base.OnDisable();
}
protected override void OnDidApplyAnimationProperties()
{
if ((UnityEngine.Object) this.graphic != (UnityEngine.Object) null)
this.graphic.SetVerticesDirty();
base.OnDidApplyAnimationProperties();
}
protected override void OnValidate()
{
base.OnValidate();
if (!((UnityEngine.Object) this.graphic != (UnityEngine.Object) null))
return;
this.graphic.SetVerticesDirty();
}
/// <summary>
/// <para>See:IMeshModifier.</para>
/// </summary>
/// <param name="mesh"></param>
public virtual void ModifyMesh(Mesh mesh)
{
using (VertexHelper vh = new VertexHelper(mesh))
{
this.ModifyMesh(vh);
vh.FillMesh(mesh);
}
}
public abstract void ModifyMesh(VertexHelper vh);
}
}