2 using UnityEngine
.Assertions
;
4 namespace UnityEngine
.Rendering
.PostProcessing
6 public sealed class PostProcessBundle
8 public PostProcessAttribute attribute { get; private set; }
9 public PostProcessEffectSettings settings { get; private set; }
11 internal PostProcessEffectRenderer renderer
15 if (m_Renderer
== null)
17 Assert
.IsNotNull(attribute
.renderer
);
18 var rendererType
= attribute
.renderer
;
19 m_Renderer
= (PostProcessEffectRenderer
)Activator
.CreateInstance(rendererType
);
20 m_Renderer
.SetSettings(settings
);
28 PostProcessEffectRenderer m_Renderer
;
30 internal PostProcessBundle(PostProcessEffectSettings settings
)
32 // If settings is null, it means that at some point a null element has been added to
33 // the volume effect list or there was a deserialization error and a reference to
34 // the settings scriptableobject was lost
35 Assert
.IsNotNull(settings
);
36 this.settings
= settings
;
37 attribute
= settings
.GetType().GetAttribute
<PostProcessAttribute
>();
40 internal void Release()
42 if (m_Renderer
!= null)
45 RuntimeUtilities
.Destroy(settings
);
48 internal void ResetHistory()
50 if (m_Renderer
!= null)
51 m_Renderer
.ResetHistory();
54 internal T CastSettings
<T
>()
55 where T
: PostProcessEffectSettings
60 internal T CastRenderer
<T
>()
61 where T
: PostProcessEffectRenderer