summaryrefslogtreecommitdiff
path: root/Assets/Test/04_Graphic/UI04_MeshModifierTest.cs
blob: d1bad842c3eaaa25fd5d095195ac54d5638e39b4 (plain)
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

[ExecuteInEditMode]
public class UI04_MeshModifierTest : UnityEngine.EventSystems.UIBehaviour, IMeshModifier{
    static UIVertex vert = new UIVertex();

    public void ModifyMesh(Mesh mesh)
    {
    }

    public void ModifyMesh(VertexHelper verts)
    {
        Debug.Log("ModifyMesh");
        vert.position = new Vector3(100, 100);
        vert.color = Color.white;
        verts.AddVert(vert);
        vert.position = new Vector3(120, 100);
        verts.AddVert(vert);
        vert.position = new Vector3(120, 110);
        verts.AddVert(vert);
        verts.AddTriangle(4, 5, 6);
    }

}