Esempio n. 1
0
        private static async void ProcessDependencies()
        {
            while (PackageOperationsManager.Packages == null || PackageOperationsManager.Packages.Any() == false || EditorApplication.isCompiling)
            {
                await Task.Delay(100);
            }

            float percentage = 100f / dependenciesList.Count;

            foreach (Dependency dependency in dependenciesList)
            {
                int index = dependenciesList.FindIndex(item => item == dependency);
                EditorUtility.DisplayProgressBar("Importing Creator dependencies", $"Fetching {dependency.Package}", index * percentage);

                if (PackageOperationsManager.IsPackageLoaded(dependency.Package, dependency.Version))
                {
                    if (string.IsNullOrEmpty(dependency.Version))
                    {
                        dependency.Version = PackageOperationsManager.GetInstalledPackageVersion(dependency.Package);
                    }

                    dependency.IsEnabled = true;
                }
                else
                {
                    PackageOperationsManager.LoadPackage(dependency.Package, dependency.Version);
                    return;
                }
            }

            EditorUtility.ClearProgressBar();
            OnPostProcess?.Invoke(null, new DependenciesEnabledEventArgs(dependenciesList));
        }
Esempio n. 2
0
            public bool ProcessCustomThreadClients(bool waitForTrigger = false)
            {
                var res = DistManager_processCustomThreadClients(GetNativeReference(), waitForTrigger);

                if (res)
                {
                    OnPostProcess?.Invoke(this, EventArgs.Empty);
                }

                return(res);
            }
Esempio n. 3
0
 public override void PostProcess()
 {
     OnPostProcess?.Invoke(Manager);
 }