public async void BeginEdit(Window parent) { if (RoleEditorWindow.Edit(parent, this.Source)) { this.RefreshProperties(); await this.parent.CommitAsync(); } }
// temporary debug variables // string eventtype = ""; // string mouseloc = ""; public static void Init(ScriptedObject role){ instance = (RoleEditorWindow)EditorWindow.GetWindow(typeof(RoleEditorWindow)); // be sure we don't blow away and edits when switching scripts... // instance.requestedScript = script; // what if we start running before saving ? we should probably warn for that too. // if (!(EditorApplication.isPlaying || EditorApplication.isPaused)) // don't load up yet, put up a confirmation dialog first. // instance.confirmChange=true; // return; // } instance.myLeftRole = role; instance.title = "Role Editor"; instance.leftHasChanged = false; instance.rightHasChanged = false; // EditorApplication.playmodeStateChanged += instance.PlaymodeCallback; }