Ejemplo n.º 1
0
        private void DrawSelectedPointInspector()
        {
            GUILayout.Label("Selected Point");

            //Position
            EditorGUI.BeginChangeCheck();
            Vector3 point = EditorGUILayout.Vector3Field("Position", m_Spline.GetControlPoint(m_SelectedIndex));

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(m_Spline, "Move Point");
                EditorUtility.SetDirty(m_Spline);
                m_Spline.SetControlPoint(m_SelectedIndex, point);
            }

            //Edit mode
            EditorGUI.BeginChangeCheck();
            BezierControlPointMode mode = (BezierControlPointMode)EditorGUILayout.EnumPopup("Mode", m_Spline.GetControlPointMode(m_SelectedIndex));

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(m_Spline, "Change Point Mode");
                EditorUtility.SetDirty(m_Spline);
                m_Spline.SetControlPointMode(m_SelectedIndex, mode);
            }
        }