static int set_renderPipeline(IntPtr L)
 {
     try
     {
         UnityEngine.Rendering.RenderPipelineAsset arg0 = (UnityEngine.Rendering.RenderPipelineAsset)ToLua.CheckObject <UnityEngine.Rendering.RenderPipelineAsset>(L, 2);
         UnityEngine.QualitySettings.renderPipeline = arg0;
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int GetRenderPipelineAssetAt(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
         UnityEngine.Rendering.RenderPipelineAsset o = UnityEngine.QualitySettings.GetRenderPipelineAssetAt(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int set_renderPipeline(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.QualitySettings.renderPipeline");
#endif
        try
        {
            UnityEngine.Rendering.RenderPipelineAsset arg0 = (UnityEngine.Rendering.RenderPipelineAsset)ToLua.CheckObject <UnityEngine.Rendering.RenderPipelineAsset>(L, 2);
            UnityEngine.QualitySettings.renderPipeline = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
    static int GetRenderPipelineAssetAt(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.QualitySettings.GetRenderPipelineAssetAt");
#endif
        try
        {
            ToLua.CheckArgsCount(L, 1);
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
            UnityEngine.Rendering.RenderPipelineAsset o = UnityEngine.QualitySettings.GetRenderPipelineAssetAt(arg0);
            ToLua.Push(L, o);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
        private void CheckLWRP()
        {
#if UNITY_URP && UNITY_EDITOR && UNITY_2019_1_OR_NEWER
            if (UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset != null)
            {
                return;
            }

            UnityEditor.AssetDatabase.Refresh(UnityEditor.ImportAssetOptions.ForceUpdate);
            string[] guids = UnityEditor.AssetDatabase.FindAssets("WeatherMakerLWRPProfile");
            if (guids.Length != 0)
            {
                UnityEngine.Rendering.RenderPipelineAsset asset = UnityEditor.AssetDatabase.LoadAssetAtPath <UnityEngine.Rendering.RenderPipelineAsset>(UnityEditor.AssetDatabase.GUIDToAssetPath(guids[0]));
                if (asset != null)
                {
                    UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset = asset;
                    UnityEditor.EditorUtility.DisplayDialog("Success", "Weather Maker LWRP is enabled. Check WeatherMaker/Prefab/ScriptableRenderPipeline/LWRP for example scene.", "OK");
                }
            }
#endif
        }
Example #6
0
        public static RenderPipeline GetRenderPipeline()
        {
#if UNITY_2019_1_OR_NEWER //Render pipeline is no longer expiremental
            UnityEngine.Rendering.RenderPipelineAsset renderPipelineAsset = UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset;
#else
            UnityEngine.Experimental.Rendering.RenderPipelineAsset renderPipelineAsset = UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset;
#endif

            if (renderPipelineAsset)
            {
                if (renderPipelineAsset.GetType().ToString() == "UnityEngine.Rendering.LWRP.LightweightRenderPipelineAsset") { pipeline = RenderPipeline.Lightweight; }
                if (renderPipelineAsset.GetType().ToString() == "UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset") { pipeline = RenderPipeline.Universal; }
                if (renderPipelineAsset.GetType().ToString() == "UnityEngine.Rendering.HighDefinition.HDRenderPipelineAsset") { pipeline = RenderPipeline.HighDefinition; }
            }
            else { pipeline = RenderPipeline.Legacy; }

#if SCPE_DEV
            Debug.Log("<b>" + SCPE.ASSET_NAME + "</b> Pipeline active: " + pipeline.ToString());
#endif

            return pipeline;
        }