Ejemplo n.º 1
0
        private bool CheckRendererFeatureConfig()
        {
            UniversalRenderPipelineAsset uAsset   = UniversalRenderPipeline.asset;
            ScriptableRenderer           renderer = uAsset.scriptableRenderer;
            PropertyInfo rendererFeaturesProperty = renderer.GetType().GetProperty("rendererFeatures", BindingFlags.Instance | BindingFlags.NonPublic);

            if (rendererFeaturesProperty != null)
            {
                List <ScriptableRendererFeature> rendererFeatures = rendererFeaturesProperty.GetValue(renderer) as List <ScriptableRendererFeature>;
                if (rendererFeatures != null)
                {
                    bool waterFxFeatureAdded = false;
                    for (int i = 0; i < rendererFeatures.Count; ++i)
                    {
                        if (rendererFeatures[i] is PWaterEffectRendererFeature)
                        {
                            waterFxFeatureAdded = true;
                        }
                    }
                    return(waterFxFeatureAdded);
                }
            }
            return(true);
        }