Skip to content

Commit

Permalink
Changed RenderPipelineManager.activeRenderPipelineTypeChanged from in…
Browse files Browse the repository at this point in the history
…ternal to public (Unity-Technologies#4572)

* [VFX] make sure to use the now public callback activeRenderPipelineTypeChanged

* Fixed typo
  • Loading branch information
jenniferd-unity authored May 25, 2021
1 parent b46a7e8 commit 1bf0350
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions com.unity.visualeffectgraph/Editor/Core/VFXLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -609,15 +609,7 @@ public static VFXSRPBinder currentSRPBinder
[InitializeOnLoadMethod]
private static void RegisterSRPChangeCallback()
{
EventInfo onRPChanged = typeof(RenderPipelineManager).GetEvent("activeRenderPipelineTypeChanged", BindingFlags.NonPublic | BindingFlags.Static);
if (onRPChanged != null)
{
MethodInfo addHandler = onRPChanged.GetAddMethod(nonPublic: true);
addHandler.Invoke(null, new Action[] { SRPChanged });
}

// Once activeRenderPipelineTypeChanged is public don't use reflection anymore
//RenderPipelineManager.activeRenderPipelineTypeChanged += OnSRPChanged;
RenderPipelineManager.activeRenderPipelineTypeChanged += SRPChanged;
}

public delegate void OnSRPChangedEvent();
Expand Down

0 comments on commit 1bf0350

Please sign in to comment.