void GetAndSetActiveRenderPipelineSettings()
        {
            ToolboxHelper.RenderPipeline m_ActiveRenderPipeline = ToolboxHelper.GetRenderPipeline();
            m_VisualizationMaterial = AssetDatabase.LoadAssetAtPath <Material>("Packages/com.unity.terrain-tools/editor/terraintoolbox/materials/terrainvisualization.mat");

            switch (m_ActiveRenderPipeline)
            {
            case ToolboxHelper.RenderPipeline.HD:
                m_VisualizationMaterial.shader = AssetDatabase.LoadAssetAtPath <Shader>(k_HDRPShaderPath);
                break;

            case ToolboxHelper.RenderPipeline.Universal:
                m_VisualizationMaterial.shader = AssetDatabase.LoadAssetAtPath <Shader>(k_URPShaderPath);
                break;

            default:
                if (m_Terrains == null || m_Terrains.Count == 0)
                {
                    break;
                }
#if UNITY_2019_2_OR_NEWER
#else
                m_TerrainMaterialType = m_Terrains[0].materialType;
                if (m_TerrainMaterialType == Terrain.MaterialType.BuiltInLegacySpecular)
                {
                    m_TerrainLegacyShininess = m_Terrains[0].legacyShininess;
                    m_TerrainLegacySpecular  = m_Terrains[0].legacySpecular;
                }
#endif
                m_VisualizationMaterial.shader = Shader.Find("Hidden/Builtin_TerrainVisualization");
                break;
            }
        }
コード例 #2
0
        void GetAndSetActiveRenderPipelineSettings()
        {
            ToolboxHelper.RenderPipeline m_ActiveRenderPipeline = ToolboxHelper.GetRenderPipeline();
            switch (m_ActiveRenderPipeline)
            {
            case ToolboxHelper.RenderPipeline.HD:
                m_MaxLayerCount = kMaxLayerHD;
                break;

            case ToolboxHelper.RenderPipeline.LW:
                m_MaxLayerCount = kMaxNoLimit;
                break;

            default:
                m_MaxLayerCount = kMaxNoLimit;
                break;
            }
        }