NGUI:
public class UIGeometry
{
public BetterList<Vector3> verts = new BetterList<Vector3>();
public BetterList<Vector2> uvs = new BetterList<Vector2>();
public BetterList<Color32> cols = new BetterList<Color32>();
public BetterList<<Vector3> mRtpVerts = new BetterList<Vector32>();
}
UGUI:
public class VertexHelper:IDisaposable
{
private List<Vector3> m_Positions = ListPool<Vector3>.Get();
private List<Color32> m_Colors = ListPool<Color32>.Get();
private List<Vector2> m_Uv0s = ListPool<Vector2>.Get();
private List<Vector2> m_Uv1s = ListPool<Vector2>.Get();
private List<Vector3> m_Normals = ListPool<Vector3>.Gte();
private List<Vector4> m_Tangents = ListPool<Vector4>.Get();
private List<int> m_Indices = ListPool<int>.Get();
}
元素更新方式:
NGUI:
UIPanel.LateUpdate
1.轮询
2.UIPanel.UpdateWidgets
UGUI:
Canvas.SendWillRenderCanvas
1.队列
2.m_LayoutRebuildQueue
3.m_GraphicRebuildQueue
UGUI如果Canvas没有变化Canvas.SendWillRenderCanvas是完全没有开销的
处理隐藏显示元素方式
NGUI:
1.大量的SetActive(false),
2.适量的Color.a = 0 ,移出
3.Time + 二级缓存
UGUI
1.scale = 0,Alpha Group = 0
修改一个UI元素最终会转变成很多组的顶点属性,同过这些顶点属性转换成mesh。动态的UI元素要控制数组里面的顶点数。
对于制作的影响:
1.“动态”元素尽量少用OutLine.Tiled Sprite。
2.尽量减少“动态”长文本。
待补充。。。