コード例 #1
0
        void OnEnable()
        {
            if (window == null)
            {
                window         = this;
                window.minSize = new Vector2(320, 0);
            }

            if (!IsEventHandlerRegistered(StateUpdateHandler))
            {
                EdExStateUpdate += StateUpdateHandler;
            }

            PlayFabEditorPrefsSO.Instance.PanelIsShown = true;
            PlayFabEditorDataService.RefreshStudiosList(true);
            GetLatestEdExVersion();

            root = rootVisualElement;
            root.Clear();

            root.AddChildrenOf(new Header());
            root.Add(new IMGUIContainer().AssignTo(out var progressBar));
            progressBar.onGUIHandler = ProgressBar.Draw;
            root.Add(new Menu().AssignTo(out menu));
            root.Add(new IMGUIContainer().Set(name: "mainIMGUI", flexGrow: 1).AssignTo(out mainIMGUI));
            rootVisualElement.styleSheets.Add(AssetDatabase.LoadAssetAtPath <StyleSheet>(Path.Combine(Strings.PATH_UI, "styles.uss")));
            //var template = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(Path.Combine(Strings.PATH_UI, "mainView.uxml"));
            //StylePropertyReader tree = new TemplateContainer();
            //template.CloneTree(root);


            Update();
        }