public virtual void Setup() { if (EditorApplication.isPlaying) { BuilderWindow = EditorWindow.GetWindow <Builder>(); } else { BuilderWindow = BuilderTestsHelper.MakeNewBuilderWindow(); } Selection = BuilderWindow.selection; Canvas = BuilderWindow.rootVisualElement.Q <BuilderCanvas>(); LibraryPane = BuilderWindow.rootVisualElement.Q <BuilderLibrary>(); HierarchyPane = BuilderWindow.rootVisualElement.Q <BuilderHierarchy>(); StyleSheetsPane = BuilderWindow.rootVisualElement.Q <BuilderStyleSheets>(); ViewportPane = BuilderWindow.rootVisualElement.Q <BuilderViewport>(); InspectorPane = BuilderWindow.rootVisualElement.Q <BuilderInspector>(); if (EditorApplication.isPlaying) { return; } BuilderProjectSettings.Reset(); ForceNewDocument(); var createSelectorField = StyleSheetsPane.Q <TextField>(); createSelectorField.visualInput.Blur(); LibraryPane.SetViewMode(BuilderLibrary.LibraryViewMode.TreeView); }
public virtual void Setup() { if (EditorApplication.isPlaying) { builder = EditorWindow.GetWindow <Builder>(); } else { builder = BuilderTestsHelper.MakeNewBuilderWindow(); } selection = builder.selection; canvas = builder.rootVisualElement.Q <BuilderCanvas>(); library = builder.rootVisualElement.Q <BuilderLibrary>(); hierarchy = builder.rootVisualElement.Q <BuilderHierarchy>(); styleSheetsPane = builder.rootVisualElement.Q <BuilderStyleSheets>(); viewport = builder.rootVisualElement.Q <BuilderViewport>(); toolbar = viewport.Q <BuilderToolbar>(); inspector = builder.rootVisualElement.Q <BuilderInspector>(); if (EditorApplication.isPlaying) { return; } BuilderProjectSettings.Reset(); ForceNewDocument(); var createSelectorField = styleSheetsPane.Q <TextField>(); createSelectorField.visualInput.Blur(); library.SetViewMode(BuilderLibrary.LibraryViewMode.TreeView); }