private void ImportLayout() { VisualElement root = rootVisualElement; // Import UXML var visualTree = AssetDatabase.LoadAssetAtPath <VisualTreeAsset>(Path.Combine(MainPaths.UxmlRoot, "BTWindowLayout.uxml")); VisualElement windowLayout = visualTree.Instantiate(); root.Add(windowLayout); windowLayout.StretchToParentSize(); // Import USS var styleSheet = AssetDatabase.LoadAssetAtPath <StyleSheet>(Path.Combine(MainPaths.UssRoot, "BTWindowStyles.uss")); root.styleSheets.Add(styleSheet); _graphContainer = rootVisualElement.Q(name: "graph-container"); _toolbar = rootVisualElement.Q(className: "window-toolbar"); _playmodeWatcher = _toolbar.Q <PlaymodeWatcher>(); _treeSelector = _toolbar.Q <TreeSelector>(); _graph = new BTGraph(); _graph.Initialize(); _graphContainer.Add(_graph); _graph.OnStructureChanged += UpdatePlaymodeWatcher; }
private void ImportLayout() { VisualElement root = rootVisualElement; // Import UXML var visualTree = AssetDatabase.LoadAssetAtPath <VisualTreeAsset>(System.IO.Path.Combine(MainPaths.UxmlRoot, "BBWatcherWindowLayout.uxml")); VisualElement windowLayout = visualTree.Instantiate(); root.Add(windowLayout); windowLayout.StretchToParentSize(); // Import USS var styleSheet = AssetDatabase.LoadAssetAtPath <StyleSheet>(System.IO.Path.Combine(MainPaths.UssRoot, "BTWindowStyles.uss")); root.styleSheets.Add(styleSheet); _bbContainer = rootVisualElement.Q(name: "bb-container"); _toolbar = rootVisualElement.Q(className: "window-toolbar"); _playmodeWatcher = _toolbar.Q <PlaymodeWatcher>(); _treeSelector = _toolbar.Q <TreeSelector>(); }