Example #1
0
        /// <summary>
        /// Sets the pipeline asset to the procedural worlds asset if the profile is set yo change it
        /// </summary>
        /// <param name="profile"></param>
        public static void SetPipelineAsset(UnityPipelineProfile profile)
        {
            try
            {
                GaiaPackageVersion        unityVersion = GaiaManagerEditor.GetPackageVersion();
                UnityVersionPipelineAsset mapping      = profile.m_universalPipelineProfiles.Find(x => x.m_unityVersion == unityVersion);
                string pipelineAssetName = "";
                if (mapping != null)
                {
                    pipelineAssetName = mapping.m_pipelineAssetName;
                }
                else
                {
                    Debug.LogError("Could not determine the correct render pipeline settings asset for this unity version / rendering pipeline!");
                    return;
                }

                GraphicsSettings.renderPipelineAsset = AssetDatabase.LoadAssetAtPath <RenderPipelineAsset>(GaiaUtils.GetAssetPath(pipelineAssetName + GaiaConstants.gaiaFileFormatAsset));
                profile.m_pipelineSwitchUpdates      = true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Example #2
0
        /// <summary>
        /// Sets the pipeline asset to the procedural worlds asset if the profile is set yo change it
        /// </summary>
        /// <param name="profile"></param>
        public static void SetPipelineAsset(UnityPipelineProfile profile)
        {
            if (GraphicsSettings.renderPipelineAsset == null)
            {
                GaiaPackageVersion unityVersion = GaiaPackageVersion.Unity2019_1;

                //Installation setup
                if (Application.unityVersion.Contains("2019.2"))
                {
                    unityVersion = GaiaPackageVersion.Unity2019_2;
                }
                else if (Application.unityVersion.Contains("2019.3"))
                {
                    unityVersion = GaiaPackageVersion.Unity2019_3;
                }

                UnityVersionPipelineAsset mapping = profile.m_lightweightPipelineProfiles.Find(x => x.m_unityVersion == unityVersion);
                string pipelineAssetName          = "";

                if (mapping != null)
                {
                    pipelineAssetName = mapping.m_pipelineAssetName;
                }
                else
                {
                    Debug.LogError("Could not determine the correct render pipeline settings asset for this unity version / rendering pipeline!");
                    return;
                }

                GraphicsSettings.renderPipelineAsset = AssetDatabase.LoadAssetAtPath <RenderPipelineAsset>(GetAssetPath(pipelineAssetName));
            }

            profile.m_pipelineSwitchUpdates = true;
        }