private void OnEnable()
        {
            _path        = target as CubicPath;
            _state       = EditorState.LoadOrCreateFor(target);
            _loop        = serializedObject.FindProperty("_loop");
            _points      = serializedObject.FindProperty("_points");
            _handlesIcon = EditorGUIUtility.IconContent(SHOW_HANDLES_ICON).image;

            _separatorLineStyle = new GUIStyle();
            _separatorLineStyle.normal.background = EditorGUIUtility.whiteTexture;
            _separatorLineStyle.margin            = new RectOffset(0, 0, 4, 4);
            _separatorLineStyle.fixedHeight       = 1;

            if (!_state.PropertyExists <int>(SUBS_KEY))
            {
                _state.SetProperty(SUBS_KEY, MIN_SUBDIVISIONS);
            }
            if (!_state.PropertyExists <bool>(EDIT_INTERP_KEY))
            {
                _state.SetProperty(EDIT_INTERP_KEY, false);
            }
            if (!_state.PropertyExists <bool>(SHOW_HANDLES_KEY))
            {
                _state.SetProperty(SHOW_HANDLES_KEY, false);
            }
            if (!_state.PropertyExists <bool>(POINTS_COLLAPSED_KEY))
            {
                _state.SetProperty(POINTS_COLLAPSED_KEY, false);
            }
            if (!_state.PropertyExists <Space>(COORDS_SYSTEM_KEY))
            {
                _state.SetProperty(COORDS_SYSTEM_KEY, Space.Self);
            }

            PreparePointsList();
        }
Exemple #2
0
 public PropertyImpl(EditorState state, string key) : base(state, key)
 {
 }