-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathCuttingManagerEditor.cs
More file actions
38 lines (32 loc) · 1.41 KB
/
CuttingManagerEditor.cs
File metadata and controls
38 lines (32 loc) · 1.41 KB
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
28
29
30
31
32
33
34
35
36
37
38
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using SofaUnity;
namespace SofaUnity
{
[CustomEditor(typeof(CuttingManager), true)]
public class CuttingManagerEditor : Editor
{
public override void OnInspectorGUI()
{
CuttingManager model = this.target as CuttingManager;
if (model == null)
return;
model.m_sofaCuttingMgr = (SofaComponent)EditorGUILayout.ObjectField("SofaCuttingController", model.m_sofaCuttingMgr, typeof(SofaComponent), true);
EditorGUILayout.ObjectField("Point A", model.m_pointA, typeof(GameObject), true);
EditorGUILayout.ObjectField("Point B", model.m_pointB, typeof(GameObject), true);
EditorGUILayout.ObjectField("Point C", model.m_pointC, typeof(GameObject), true);
model.CutPointA = EditorGUILayout.Vector3Field("CutPointA", model.CutPointA);
model.CutPointB = EditorGUILayout.Vector3Field("CutPointB", model.CutPointB);
model.CutDirection = EditorGUILayout.Vector3Field("CutDirection", model.CutDirection);
model.CutDepth = EditorGUILayout.FloatField("CutDepth", model.CutDepth);
EditorGUILayout.Separator();
if (GUILayout.Button("Process Cut"))
{
model.performCut();
}
EditorGUILayout.Separator();
}
}
}