public static void CreateGraph(MenuCommand menuCommand)
        {
            const string path = "Assets";
            var template = new GraphTemplate<MathBookStencil>(MathBookStencil.GraphName);
            CommandDispatcher commandDispatcher = null;
            if (EditorWindow.HasOpenInstances<SimpleGraphViewWindow>())
            {
                var window = EditorWindow.GetWindow<SimpleGraphViewWindow>();
                if (window != null)
                {
                    commandDispatcher = window.CommandDispatcher;
                }
            }

            GraphAssetCreationHelpers<MathBookAsset>.CreateInProjectWindow(template, commandDispatcher, path);
        }
Esempio n. 2
0
        public static void CreateGraph(MenuCommand menuCommand)
        {
            const string      path              = "Assets";
            var               template          = new GraphTemplate <VerticalStencil>(VerticalStencil.k_GraphName);
            CommandDispatcher commandDispatcher = null;

            if (EditorWindow.HasOpenInstances <VerticalGraphWindow>())
            {
                var window = EditorWindow.GetWindow <VerticalGraphWindow>();
                if (window != null)
                {
                    commandDispatcher = window.CommandDispatcher;
                }
            }

            GraphAssetCreationHelpers <VerticalGraphAssetModel> .CreateInProjectWindow(template, commandDispatcher, path);
        }