14 [RequireComponent(typeof(CanvasRenderer))]
23 protected int m_Index = -1;
24 protected Type m_Type = Type.Base;
25 protected bool m_Refresh;
26 protected Action<VertexHelper, Painter> m_OnPopulateMesh;
28 public Action<VertexHelper, Painter> onPopulateMesh {
set { m_OnPopulateMesh = value; } }
29 public int index {
get {
return m_Index; }
set { m_Index = value; } }
30 public Type type {
get {
return m_Type; }
set { m_Type = value; } }
33 if (gameObject ==
null)
return;
34 if (!gameObject.activeSelf)
return;
40 raycastTarget =
false;
43 public void SetActive(
bool flag,
bool isDebugMode =
false)
45 if (gameObject.activeInHierarchy != flag)
47 gameObject.SetActive(flag);
49 var hideFlags = flag && isDebugMode ? HideFlags.None : HideFlags.HideInHierarchy;
50 if (gameObject.hideFlags != hideFlags)
52 gameObject.hideFlags = hideFlags;
56 protected override void Awake()
61 internal void CheckRefresh()
63 if (m_Refresh && gameObject.activeSelf)
70 protected override void OnPopulateMesh(VertexHelper vh)
73 if (m_OnPopulateMesh !=
null)
75 m_OnPopulateMesh(vh,
this);