示例#1
0
    void Square4(SubMesh data, CardShape shape, Vector3 v0, Vector3 v1, Vector3 v2, Vector3 v3, Color color, bool vflip, bool hflip)
    {
        int     vi = data.VertexList.Count;
        Vector2 t0 = shape.UV3;
        Vector2 t1 = shape.UV2;
        Vector2 t2 = shape.UV1;
        Vector2 t3 = shape.UV0;

        if (!vflip)
        {
            if (hflip)
            {
                data.AddVertex(v0, t2, color);
                data.AddVertex(v1, t3, color);
                data.AddVertex(v2, t0, color);
                data.AddVertex(v3, t1, color);
            }
            else
            {
                data.AddVertex(v0, t3, color);
                data.AddVertex(v1, t2, color);
                data.AddVertex(v2, t1, color);
                data.AddVertex(v3, t0, color);
            }
        }
        else
        {
            if (hflip)
            {
                data.AddVertex(v0, t1, color);
                data.AddVertex(v1, t0, color);
                data.AddVertex(v2, t3, color);
                data.AddVertex(v3, t2, color);
            }
            else
            {
                data.AddVertex(v0, t0, color);
                data.AddVertex(v1, t1, color);
                data.AddVertex(v2, t2, color);
                data.AddVertex(v3, t3, color);
            }
        }
        data.AddTriangle(vi, vi + 1, vi + 2);
        data.AddTriangle(vi, vi + 2, vi + 3);
    }
示例#2
0
 void VertexUV(SubMesh data, CardShape shape, Vector3 pos, Vector2 uv)
 {
     data.AddVertex(pos, uv, Color.white);
 }