Ejemplo n.º 1
0
            public void RenderProperties()
            {
                if (_editableObject == null)
                {
                    throw new Exception();
                }

                //If store an undo command on a temp string representing event, then on undo performed callback recreate event from string.
                string undoObjectXml = SerializeConverter.ToString(_editableObject);

                if (RenderObjectProperties(GUIContent.none))
                {
                    _undoObjectXml = undoObjectXml;
                    Undo.RegisterCompleteObjectUndo(this, GetEditableObject().GetType().Name + " changed");
                    SaveUndoState();

                    GetEditor().SetNeedsRepaint();
                    MarkAsDirty(true);
                }
            }
Ejemplo n.º 2
0
 public void SaveUndoState()
 {
     _undoObjectXml = SerializeConverter.ToString(_editableObject);
 }
                private void SaveEditorPrefs()
                {
                    string prefsXml = SerializeConverter.ToString(_editorPrefs);

                    EditorPrefs.SetString(_editorPrefsTag, prefsXml);
                }