Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit 354ff17

Browse files
committed
Custom userData refactor
Turned it into a map to make it actually useful so that multiple effects can exchange data
1 parent f0e0489 commit 354ff17

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

PostProcessing/Runtime/PostProcessRenderContext.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System.Collections.Generic;
2+
13
namespace UnityEngine.Rendering.PostProcessing
24
{
35
#if UNITY_2017_2_OR_NEWER
@@ -75,10 +77,9 @@ public Camera camera
7577
// Property sheet factory handled by the currently active PostProcessLayer
7678
public PropertySheetFactory propertySheets { get; internal set; }
7779

78-
// Custom user data object (unused by builtin effects, feel free to store whatever you want
79-
// in this object)
80-
// TODO: Make this more useful
81-
public object userData { get; set; }
80+
// Custom user data objects (unused by builtin effects, feel free to store whatever you want
81+
// in this dictionary)
82+
public Dictionary<string, object> userData { get; private set; }
8283

8384
// Reference to the internal debug layer
8485
public PostProcessDebugLayer debugLayer { get; internal set; }
@@ -136,6 +137,11 @@ public void Reset()
136137
autoExposureTexture = null;
137138
logLut = null;
138139
autoExposure = null;
140+
141+
if (userData == null)
142+
userData = new Dictionary<string, object>();
143+
144+
userData.Clear();
139145
}
140146

141147
// Checks if TAA is enabled & supported

0 commit comments

Comments
 (0)