Example #1
0
        private static void UpdateGroupVersion(PackageCollection collection, bool blocking)
        {
            AssetDatabase.StartAssetEditing();

            try
            {
                if (PackageGroupConfiguration.IsUseGroupVersion())
                {
                    string newVersion = PackageGroupConfiguration.GetGroupVersion();
                    foreach (var package in collection)
                    {
                        if (package.source == PackageSource.Embedded)
                        {
                            UpdatePackageVersion(package, newVersion);
                        }
                    }
                }
            }
            finally
            {
                AssetDatabase.StopAssetEditing();
            }

            ListRequest(null, UpdateDependencies, blocking);
        }
Example #2
0
 internal static void UpdateVersionInformation(bool blocking)
 {
     if (PackageGroupConfiguration.IsUseGroupVersion())
     {
         ListRequest(null, UpdateGroupVersion, blocking);
     }
     else
     {
         ListRequest(null, UpdateDependencies, blocking);
     }
 }
Example #3
0
        void OnEnable()
        {
            HalodiPackageCreatorController.LoadPackages((p) => packages = p, UnityEditor.PackageManager.PackageSource.Embedded);
            minSize = new Vector2(640, 320);

            useGroupVersion = PackageGroupConfiguration.IsUseGroupVersion();
            if (useGroupVersion)
            {
                groupVersion = PackageGroupConfiguration.GetGroupVersion();
            }
            else
            {
                groupVersion = "0.0.0";
            }
        }
        void OnEnable()
        {
            packages = HalodiPackageCreatorController.LoadPackages();
            minSize  = new Vector2(640, 320);

            useGroupVersion = PackageGroupConfiguration.IsUseGroupVersion();
            if (useGroupVersion)
            {
                groupVersion = PackageGroupConfiguration.GetGroupVersion();
            }
            else
            {
                groupVersion = "0.0.0";
            }
        }
Example #5
0
 private void ApplyGroupVersion()
 {
     if (PackageGroupConfiguration.IsValidVersion(groupVersion))
     {
         PackageGroupConfiguration.SetGroupVersion(groupVersion);
     }
     else
     {
         EditorUtility.DisplayDialog("Invalid version", "Version is not a semantic version (major.minor.patch).", "OK");
         if (PackageGroupConfiguration.IsUseGroupVersion())
         {
             groupVersion = PackageGroupConfiguration.GetGroupVersion();
         }
         else
         {
             groupVersion = "0.0.0";
         }
     }
 }
Example #6
0
        void OnGUI()
        {
            EditorGUILayout.LabelField("Packages in this project", EditorStyles.whiteLargeLabel);

            EditorGUILayout.Space();

            EditorGUI.BeginChangeCheck();
            useGroupVersion = EditorGUILayout.ToggleLeft("Use common version for all packages in this project", useGroupVersion);

            if (EditorGUI.EndChangeCheck())
            {
                if (!useGroupVersion)
                {
                    PackageGroupConfiguration.UnsetGroupVersion();
                }
            }


            if (useGroupVersion)
            {
                EditorGUILayout.BeginHorizontal();
                groupVersion = EditorGUILayout.TextField("Group version: ", groupVersion);
                if (GUILayout.Button("Apply"))
                {
                    ApplyGroupVersion();
                }
                EditorGUILayout.EndHorizontal();
            }


            EditorGUILayout.Space();

            scrollPos = EditorGUILayout.BeginScrollView(scrollPos);


            foreach (PackageManifest package in packages)
            {
                GUIStyle boxStyle = new GUIStyle();
                boxStyle.padding = new RectOffset(10, 10, 0, 0);

                EditorGUILayout.BeginHorizontal(boxStyle);
                EditorGUILayout.LabelField(package.displayName);
                if (GUILayout.Button("Edit"))
                {
                    EditPackage(package);
                }
                if (GUILayout.Button("Add sample"))
                {
                    AddSample(package);
                }
                if (GUILayout.Button("Pack"))
                {
                    Pack(package);
                }

                EditorGUILayout.EndHorizontal();
            }

            EditorGUILayout.EndScrollView();

            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Publish"))
            {
                PublishPackages();
            }

            if (GUILayout.Button("New package"))
            {
                NewPackage();
            }

            if (GUILayout.Button("Close"))
            {
                CloseWindow();
            }
            EditorGUILayout.EndHorizontal();
        }