Esempio n. 1
0
        private void CreateToolbar()
        {
            _toolbar = new Toolbar();
            StyleSheetUtils.AddStyleSheets(_toolbar, "Toolbar");

            _toolbar.Add(new Button(() => SaveLoadUtils.SaveGraphView(_graphView, AssetGuid))
            {
                text = "Save"
            });

            _toolbar.Add(new Button(() => SaveLoadUtils.LoadGraphViewAsset(_graphView))
            {
                text = "Load"
            });

            var toggleMiniMap = new Toggle("MiniMap");

            toggleMiniMap.RegisterValueChangedCallback((change) => {
                _miniMap.visible = change.newValue;
            });
            _miniMap.visible = toggleMiniMap.value;
            _toolbar.Add(toggleMiniMap);

            rootVisualElement.Add(_toolbar);
        }
Esempio n. 2
0
 protected BaseNode()
 {
     AddToClassList("BaseNode");
     StyleSheetUtils.AddStyleSheets(this, "Node");
     title = this.DisplayName;
 }
Esempio n. 3
0
 private EasyGraphView()
 {
     StyleSheetUtils.AddStyleSheets(this, "GraphView");
 }