static void AnimExportTool() { if (XEditorUtil.MakeNewScene()) { if (preview != null) { ScriptableObject.DestroyImmediate(preview); } var window = EditorWindow.GetWindowWithRect(typeof(FashionPreview), new Rect(0, 0, 440, 640), true, "Preview"); preview = window as FashionPreview; preview.Show(); } }