public static PackageInfo Refresh(PackageInfo info)
 {
     if (info != null)
     {
         RefreshReleaseNotes(info);
     }
     return info;
 }
Example #2
0
        protected string GetFileInPackageOrDefault(string path)
        {
            Unity.DataContract.PackageInfo packageInfo = BaseIl2CppPlatformProvider.FindIl2CppPackage();
            if (packageInfo == null)
            {
                return(Path.Combine(this.libraryFolder, path));
            }
            string text = Path.Combine(packageInfo.basePath, path);

            return(File.Exists(text) ? text : Path.Combine(this.libraryFolder, path));
        }
Example #3
0
        // instantiate package manager and add it to the native assembly list for automatic loading at domain reloads (play mode start, etc)
        static bool InitializePackageManager(Unity.DataContract.PackageInfo package)
        {
            string dll = package.files.Where(x => x.Value.type == PackageFileType.Dll).Select(x => x.Key).FirstOrDefault();

            if (dll == null || !File.Exists(Path.Combine(package.basePath, dll)))
            {
                return(false);
            }
            InternalEditorUtility.SetPlatformPath(package.basePath);
            Assembly assembly = InternalEditorUtility.LoadAssemblyWrapper(Path.GetFileName(dll), Path.Combine(package.basePath, dll));

            return(InitializePackageManager(assembly, package));
        }
Example #4
0
        private static string ConfigurationProviderAssembliesPathArgument()
        {
            StringBuilder builder = new StringBuilder();
            IEnumerator <Unity.DataContract.PackageInfo> enumerator = ModuleManager.packageManager.unityExtensions.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    Unity.DataContract.PackageInfo current = enumerator.Current;
                    if (< > f__am$cache2 == null)
                    {
                        < > f__am$cache2 = f => f.Value.type == PackageFileType.Dll;
                    }
Example #5
0
        private static bool InitializePackageManager(Unity.DataContract.PackageInfo package)
        {
            string text = (from x in package.files
                           where x.Value.type == PackageFileType.Dll
                           select x.Key).FirstOrDefault <string>();

            if (text == null || !File.Exists(Path.Combine(package.basePath, text)))
            {
                return(false);
            }
            InternalEditorUtility.SetPlatformPath(package.basePath);
            Assembly assembly = InternalEditorUtility.LoadAssemblyWrapper(Path.GetFileName(text), Path.Combine(package.basePath, text));

            return(ModuleManager.InitializePackageManager(assembly, package));
        }
        protected string GetFolderInPackageOrDefault(string path)
        {
            Unity.DataContract.PackageInfo packageInfo = BaseIl2CppPlatformProvider.FindIl2CppPackage();
            string result;

            if (packageInfo == null)
            {
                result = Path.Combine(this.libraryFolder, path);
            }
            else
            {
                string text = Path.Combine(packageInfo.basePath, path);
                result = (Directory.Exists(text) ? text : Path.Combine(this.libraryFolder, path));
            }
            return(result);
        }
Example #7
0
        static bool InitializePackageManager(Assembly assembly, Unity.DataContract.PackageInfo package)
        {
            s_PackageManager = AssemblyHelper.FindImplementors <IPackageManagerModule>(assembly).FirstOrDefault();

            if (s_PackageManager == null)
            {
                return(false);
            }

            string dllpath = assembly.Location;

            // if we have a package, it's because it came from the locator, which means we need to setup the dll
            // for loading on the next domain reloads
            if (package != null)
            {
                InternalEditorUtility.RegisterPrecompiledAssembly(Path.GetFileName(dllpath), dllpath);
            }

            else // just set the package with the path to the loaded assembly so package manager can get its information from there
            {
                package = new Unity.DataContract.PackageInfo()
                {
                    basePath = Path.GetDirectoryName(dllpath)
                }
            };

            s_PackageManager.moduleInfo        = package;
            s_PackageManager.editorInstallPath = EditorApplication.applicationContentsPath;
            s_PackageManager.unityVersion      = new PackageVersion(Application.unityVersion);

            s_PackageManager.Initialize();
            foreach (Unity.DataContract.PackageInfo engine in s_PackageManager.playbackEngines)
            {
                BuildTargetGroup buildTargetGroup;
                BuildTarget      target;
                if (!TryParseBuildTarget(engine.name, out buildTargetGroup, out target))
                {
                    continue;
                }

                if (EnableLogging)
                {
                    Console.WriteLine("Setting {4}:{0} v{1} for Unity v{2} to {3}", target, engine.version, engine.unityVersion, engine.basePath, buildTargetGroup);
                }
                foreach (var file in engine.files.Where(f => f.Value.type == PackageFileType.Dll))
                {
                    string fullPath = Paths.NormalizePath(Path.Combine(engine.basePath, file.Key));
                    if (!File.Exists(fullPath))
                    {
                        Debug.LogWarningFormat("Missing assembly \t{0} for {1}. Player support may be incomplete.", engine.basePath, engine.name);
                    }
                    else
                    {
                        InternalEditorUtility.RegisterPrecompiledAssembly(Path.GetFileName(dllpath), dllpath);
                    }
                }
                BuildPipeline.SetPlaybackEngineDirectory(target, BuildOptions.None /* TODO */, engine.basePath);
                InternalEditorUtility.SetPlatformPath(engine.basePath);
                s_PackageManager.LoadPackage(engine);
            }
            return(true);
        }
 private static void RefreshReleaseNotes(PackageInfo package)
 {
     if (string.IsNullOrEmpty(package.releaseNotes))
     {
         if (<>f__am$cache0 == null)
         {
Example #9
0
        private static bool InitializePackageManager(Assembly assembly, Unity.DataContract.PackageInfo package)
        {
            ModuleManager.s_PackageManager = AssemblyHelper.FindImplementors <IPackageManagerModule>(assembly).FirstOrDefault <IPackageManagerModule>();
            bool result;

            if (ModuleManager.s_PackageManager == null)
            {
                result = false;
            }
            else
            {
                string location = assembly.Location;
                if (package != null)
                {
                    InternalEditorUtility.RegisterPrecompiledAssembly(Path.GetFileName(location), location);
                }
                else
                {
                    package = new Unity.DataContract.PackageInfo
                    {
                        basePath = Path.GetDirectoryName(location)
                    };
                }
                ModuleManager.s_PackageManager.moduleInfo        = package;
                ModuleManager.s_PackageManager.editorInstallPath = EditorApplication.applicationContentsPath;
                ModuleManager.s_PackageManager.unityVersion      = new PackageVersion(Application.unityVersion);
                ModuleManager.s_PackageManager.Initialize();
                foreach (Unity.DataContract.PackageInfo current in ModuleManager.s_PackageManager.playbackEngines)
                {
                    BuildTargetGroup buildTargetGroup;
                    BuildTarget      buildTarget;
                    if (ModuleManager.TryParseBuildTarget(current.name, out buildTargetGroup, out buildTarget))
                    {
                        if (ModuleManager.EnableLogging)
                        {
                            Console.WriteLine("Setting {4}:{0} v{1} for Unity v{2} to {3}", new object[]
                            {
                                buildTarget,
                                current.version,
                                current.unityVersion,
                                current.basePath,
                                buildTargetGroup
                            });
                        }
                        foreach (KeyValuePair <string, PackageFileData> current2 in from f in current.files
                                 where f.Value.type == PackageFileType.Dll
                                 select f)
                        {
                            string path = Path.Combine(current.basePath, current2.Key).NormalizePath();
                            if (!File.Exists(path))
                            {
                                UnityEngine.Debug.LogWarningFormat("Missing assembly \t{0} for {1}. Player support may be incomplete.", new object[]
                                {
                                    current.basePath,
                                    current.name
                                });
                            }
                            else
                            {
                                InternalEditorUtility.RegisterPrecompiledAssembly(Path.GetFileName(location), location);
                            }
                        }
                        BuildPipeline.SetPlaybackEngineDirectory(buildTarget, BuildOptions.None, current.basePath);
                        InternalEditorUtility.SetPlatformPath(current.basePath);
                        ModuleManager.s_PackageManager.LoadPackage(current);
                    }
                }
                result = true;
            }
            return(result);
        }
Example #10
0
 private static bool InitializePackageManager(Unity.DataContract.PackageInfo package)
 {
     if (< > f__am$cache9 == null)
     {