Beispiel #1
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        EditorGUI.BeginChangeCheck();
        if (GUILayout.Button("Toggle closed"))
        {
            Undo.RecordObject(roadCreator, "Toggle closed");
            road.ToggleClosed();
        }
        if (GUILayout.Button("Add point"))
        {
            Undo.RecordObject(roadCreator, "Add point");
            road.AddPoint(road.roadPoints[road.NumPoints - 1]);
        }
        if (GUILayout.Button("Remove latest point"))
        {
            Undo.RecordObject(roadCreator, "Remove point");
            road.DeletePoint(road.NumPoints - 1);
        }

        if (EditorGUI.EndChangeCheck())
        {
            SceneView.RepaintAll();
        }
    }