Пример #1
0
 internal sealed override void AddTo(UnityEngine.UI.VertexHelper helper)
 {
     if (Verts != null && Indices != null)
     {
         helper.AddUIVertexStream(Verts.Select(Map).ToList(), Indices.ToList());
     }
 }
Пример #2
0
        static Immediate()
        {
            TinyGizmo.OnRender = (PrimType, Verts) => {
                Vector3[] Positions = Verts.Select((V) => V.Position.XYZ()).ToArray();
                Vector4[] Colors    = Verts.Select((V) => V.Color).ToArray();

                if (PrimType == Im3dPrimitiveType.Triangles)
                {
                    Triangles(Positions, Colors);
                }
                else if (PrimType == Im3dPrimitiveType.Lines)
                {
                    Lines(Positions, Colors, Verts.Select((V) => V.Position.W).ToArray());
                }
                else
                {
                    Points(Positions, Colors, Verts.Select((V) => V.Position.W).ToArray());
                }
            };

            TinyGizmo.GizmoInit();
        }