예제 #1
0
        public override void SetMode(int index, SplinePointMode mode)
        {
            var modeIndex = (index + 1) / 3;

            if (modeIndex >= _modes.Count)
            {
                return;
            }

            _modes[modeIndex] = mode;

            if (Loop)
            {
                if (modeIndex == 0)
                {
                    _modes[_modes.Count - 1] = mode;
                }
                else if (modeIndex == _modes.Count - 1)
                {
                    _modes[0] = mode;
                }
            }

            EnforceMode(index);
        }
    private void DrawPointModeField(int pointIndex, string label)
    {
        EditorGUI.BeginChangeCheck();

        SplinePointMode pointMode = (SplinePointMode)EditorGUILayout.EnumPopup("Mode", spline.GetPointMode(pointIndex));

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(spline, "SetSplineMode" + label + pointIndex);

            spline.SetPointMode(pointIndex, pointMode);

            EditorUtility.SetDirty(spline);
        }
    }
예제 #3
0
 public virtual void SetMode(int index, SplinePointMode mode)
 {
     throw new NotImplementedException();
 }