public static FlowCompilerWizard ShowEditor(System.Action onClose) { var rootWindow = EditorWindow.focusedWindow; var rootX = rootWindow.position.x; var rootY = rootWindow.position.y; var rootWidth = rootWindow.position.width; var rootHeight = rootWindow.position.height; var width = 600f; var height = 389f; FlowCompilerWizard editor = null; FlowCompilerWizard.FocusWindowIfItsOpen <FlowCompilerWizard>(); editor = EditorWindow.focusedWindow as FlowCompilerWizard; if (editor == null) { editor = FlowCompilerWizard.CreateInstance <FlowCompilerWizard>(); var title = "UI.Windows: Flow Compiler Wizard"; #if !UNITY_4 editor.titleContent = new GUIContent(title); #else editor.title = title; #endif editor.ShowUtility(); } editor.position = new Rect(rootX + rootWidth * 0.5f - width * 0.5f, rootY + rootHeight * 0.5f - height * 0.5f, width, height); editor.compileNamespace = FlowSystem.GetData().namespaceName; editor.forceRecompile = FlowSystem.GetData().forceRecompile; editor.partIndex = 0; editor.image = Resources.Load("UI.Windows/FlowCompiler/WizardImage") as Texture; editor.maxSize = new Vector2(width, height); editor.minSize = editor.maxSize; FlowCompilerWizard.compilationSync = new object(); editor.defaultSkin = FlowSystemEditorWindow.defaultSkin; return(editor); }
public static void ShowEditor(System.Action onClose) { FlowCompilerWizard.ShowEditor(onClose); }