Skip to content

Commit e4fffa8

Browse files
committed
Fixed Inspector Exception when drawing HDRenderLoop
1 parent d392671 commit e4fffa8

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

Assets/BasicRenderLoopTutorial/BasicRenderLoop.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ static void CreateBasicRenderLoop()
2525

2626
private ShaderPassName shaderPassBasic;
2727

28+
public void OnEnable()
29+
{
30+
Rebuild();
31+
}
32+
2833
public override void Initialize()
2934
{
3035
shaderPassBasic = new ShaderPassName("BasicPass");

Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,17 @@ public TilePass.LightLoop tilePassLightLoop
226226
TextureCache2D m_CookieTexArray;
227227
TextureCacheCubemap m_CubeCookieTexArray;
228228

229-
void OnValidate()
229+
private void OnEnable()
230230
{
231+
// TODO: Design workaround for OnValidate being missing on ScriptableObject
231232
m_Dirty = true;
233+
Rebuild();
234+
}
235+
236+
private void OnDisable()
237+
{
238+
// TODO: Rework ScriptableRenderLoop Lifecycle
239+
//CleanUp();
232240
}
233241

234242
public override void Rebuild()

Assets/ScriptableRenderLoop/fptl/FptlLighting.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,15 @@ public override void Initialize()
118118
Rebuild();
119119
}
120120

121+
private void OnEnable()
122+
{
123+
Rebuild();
124+
}
125+
121126
private void OnDisable()
122127
{
123-
CleanUp();
128+
// TODO: Rework ScriptableRenderLoop Lifecycle
129+
//CleanUp();
124130
}
125131

126132
public override void CleanUp()
@@ -151,11 +157,6 @@ public override void CleanUp()
151157
ClearComputeBuffers();
152158
}
153159

154-
void OnValidate()
155-
{
156-
Rebuild();
157-
}
158-
159160
void ClearComputeBuffers()
160161
{
161162
if (s_AABBBoundsBuffer != null)

0 commit comments

Comments
 (0)