private static void ExportReleasePackage()
        {
            if (!PrepareForRelease())
            {
                return;
            }

            var exportPath = EditorUtility.SaveFilePanel("Export Release Package",
                                                         Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
                                                         "Bolt_" + instance.version.ToString().Replace(".", "_").Replace(" ", "_"),
                                                         "unitypackage");

            if (exportPath == null)
            {
                return;
            }

            var packageDirectory = Path.GetDirectoryName(exportPath);

            var paths = new List <string>()
            {
                PathUtility.GetPackageRootPath()
            };

            AssetDatabase.ExportPackage(paths.ToArray(), exportPath, ExportPackageOptions.Recurse);

            if (EditorUtility.DisplayDialog("Export Release Package", "Release package export complete.\nOpen containing folder?", "Open Folder", "Close"))
            {
                Process.Start(packageDirectory);
            }
        }
Example #2
0
        private void OnEnable()
        {
            string pathRoot = PathUtility.GetPackageRootPath();

            UnityObject icon = EditorGUIUtility.Load(Path.Combine(pathRoot,
                                                                  "Editor/VisualScripting.Shared/EditorAssetResources/SplitButtonArrow.png"));

            dropdownIcon = new GUIContent(icon as Texture2D);

            scrollArea = new Rect(0, 0, 630, 300);

            toggleOnScript    = false;
            toggleOnState     = false;
            shouldCloseWindow = false;

            var listOfOptions = new List <DropdownOptions>
            {
                new DropdownOptions
                {
                    label    = k_OnSelectedGameObject,
                    tooltip  = k_SelectedGameObject,
                    callback = CreateScriptGraphOnSelectedGameObject
                },
                new DropdownOptions
                {
                    label    = k_OnNewGameObject,
                    callback = CreateScriptGraphOnNewGameObject
                }
            };

            splitDropdownScriptGraph = new SplitDropdown(listOfOptions);

            listOfOptions = new List <DropdownOptions>
            {
                new DropdownOptions
                {
                    label    = k_OnSelectedGameObject,
                    tooltip  = k_SelectedGameObject,
                    callback = CreateStateGraphOnSelectedGameObject
                },
                new DropdownOptions
                {
                    label    = k_OnNewGameObject,
                    callback = CreateStateGraphOnNewGameObject
                }
            };

            splitDropdownStateGraph = new SplitDropdown(listOfOptions);
        }
        private void OnEnable()
        {
            string pathRoot = PathUtility.GetPackageRootPath();

            Object icon = EditorGUIUtility.Load(Path.Combine(pathRoot,
                                                             "Editor/VisualScripting.Welcome/EditorAssetResources/SplitButtonArrow.png"));

            dropdownIcon = new GUIContent(icon as Texture2D);

            scrollArea = new Rect(0, 0, 630, 300);

            toggleOnScript    = false;
            toggleOnState     = false;
            shouldCloseWindow = false;

            List <DropdownOptions> listOfOptions = new List <DropdownOptions>();

            listOfOptions.Add(new DropdownOptions()
            {
                label    = "...on selected game object",
                tooltip  = "Please, select a gameObject",
                callback = CreateScriptGraphOnSelectedGameObject
            });
            listOfOptions.Add(new DropdownOptions()
            {
                label = "...on new game object", callback = CreateScriptGraphOnNewGameObject
            });

            splitDropdownScriptGraph = new SplitDropdown(listOfOptions);

            listOfOptions = new List <DropdownOptions>();
            listOfOptions.Add(new DropdownOptions()
            {
                label    = "...on selected game object",
                tooltip  = "Please, select a gameObject",
                callback = CreateStateGraphOnSelectedGameObject
            });
            listOfOptions.Add(new DropdownOptions()
            {
                label = "...on new game object", callback = CreateStateGraphOnNewGameObject
            });

            splitDropdownStateGraph = new SplitDropdown(listOfOptions);
        }