Esempio n. 1
0
        protected override bool DrawSelectedPointInspectorOverride()
        {
            if (m_deformer == null)
            {
                return(true);
            }

            EditorGUI.BeginChangeCheck();
            int curveIndex = SelectedIndex / 3;

            if (curveIndex == m_deformer.CurveCount)
            {
                if (m_deformer.Loop)
                {
                    curveIndex = 0;
                }
                else
                {
                    curveIndex--;
                }
            }

            ScaffoldWrapper scaffold = m_deformer.FindScaffold(curveIndex);

            if (scaffold == null)
            {
                return(true);
            }

            bool isRigid = EditorGUILayout.Toggle("Is Rigid", scaffold.IsRigid);

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(m_deformer, UNDO_CHANGEMODE);
                EditorUtility.SetDirty(m_deformer);

                m_deformer.SetIsRigid(SelectedIndex, isRigid);
            }

            return(!isRigid);
        }