Tanoda
VertexEditor.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using UnityEngine;
3
4public class VertexEditor : DragIt
5{
6 private MeshInfo m_MeshInfo;
7
8 private List<int> m_VertexIndex; // it will fill from MeshInfo by calling AddVertexIndex()
9
10 private void Awake()
11 {
12 m_VertexIndex = new List<int>();
13 }
14
15 void Start()
16 {
17 m_MeshInfo = GetComponentInParent<MeshInfo>();
18 }
19
20 private new void OnMouseDrag()
21 {
22 base.OnMouseDrag();
23 m_MeshInfo.SetVertex(m_VertexIndex, transform.localPosition);
24 }
25
30 public void AddVertexIndex(int index)
31 {
32 m_VertexIndex.Add(index);
33 }
34}
Definition: DragIt.cs:5
void SetVertex(List< int > vertexIndex, Vector3 position)
After moving a VertexEditor, it should change all vertices position
Definition: MeshInfo.cs:39
void AddVertexIndex(int index)
Adds an VertexIndex
Definition: VertexEditor.cs:30