Exemple #1
0
                public void Init(string title, IEditorWindow editorWindow, string editorPrefsTag)
                {
                    _title          = title;
                    _editorPrefsTag = editorPrefsTag;

                    string editorPrefsText = EditorPrefs.GetString(_editorPrefsTag, "");

                    _editorPrefs = SerializeConverter.FromString <NodeGraphEditorPrefs>(editorPrefsText);

                    if (_editorPrefs == null)
                    {
                        _editorPrefs = new NodeGraphEditorPrefs();
                    }

                    SetEditorWindow(editorWindow);
                    CreateViews();
                }
Exemple #2
0
            private void UndoRedoCallback()
            {
                if (this != null)
                {
                    if (!string.IsNullOrEmpty(_undoObjectXml) && _editableObject != null)
                    {
                        _editableObject = (T)SerializeConverter.FromString(_editableObject.GetType(), _undoObjectXml);
                        if (_editableObject == null)
                        {
                            throw new Exception();
                        }


                        _undoObjectXml = null;
                        GetEditor().SetNeedsRepaint();
                        MarkAsDirty(true);
                    }
                }
            }
                public void Init(string title, IEditorWindow editorWindow, string editorPrefsTag,
                                 Type[] allowedTypes, TimelineStateMachineEditorStyle style,
                                 TimelineScrollArea.eTimeFormat timeFormat = TimelineScrollArea.eTimeFormat.Seconds)
                {
                    _title          = title;
                    _editorPrefsTag = editorPrefsTag;
                    _allowedEvents  = allowedTypes;
                    _style          = style;
                    _timeFormat     = timeFormat;

                    string editorPrefsText = EditorPrefs.GetString(_editorPrefsTag, "");

                    _editorPrefs = SerializeConverter.FromString <TimelineStateMachineEditorPrefs>(editorPrefsText);

                    if (_editorPrefs == null)
                    {
                        _editorPrefs = new TimelineStateMachineEditorPrefs();
                    }

                    SetEditorWindow(editorWindow);
                    CreateViews();
                }