Skip to content

Commit 9d44b5b

Browse files
committed
Fix CoreCLR serialization and deprecation errors
- Add [Serializable] to Monitor and ParameterOverride base classes to satisfy UAC1002 serialization hierarchy checks - Add [NonSerialized] to PostProcessLayer.SerializedBundleRef.bundle to suppress UAC1001 for intentionally non-serialized field - Replace FindFirstObjectByType with FindAnyObjectByType to fix CS0618
1 parent 375c785 commit 9d44b5b

4 files changed

Lines changed: 6 additions & 1 deletion

File tree

TestProjects/PostProcessing_Tests/Assets/CommonAssets/Scripts/PostProcessingGraphicsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public IEnumerator Run(GraphicsTestCase testCase)
2020
var camera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>();
2121

2222
#if UNITY_2020_3_OR_NEWER
23-
var settings = Object.FindFirstObjectByType<PostProcessingGraphicsTestSettings>();
23+
var settings = Object.FindAnyObjectByType<PostProcessingGraphicsTestSettings>();
2424
#else
2525
var settings = Object.FindObjectOfType<PostProcessingGraphicsTestSettings>();
2626
#endif

com.unity.postprocessing/PostProcessing/Runtime/Monitors/Monitor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System;
2+
13
namespace UnityEngine.Rendering.PostProcessing
24
{
35
/// <summary>
@@ -29,6 +31,7 @@ public enum MonitorType
2931
/// <summary>
3032
/// The base class for all debug monitors.
3133
/// </summary>
34+
[Serializable]
3235
public abstract class Monitor
3336
{
3437
/// <summary>

com.unity.postprocessing/PostProcessing/Runtime/ParameterOverride.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace UnityEngine.Rendering.PostProcessing
66
/// The base abstract class for all parameter override types.
77
/// </summary>
88
/// <seealso cref="ParameterOverride{T}"/>
9+
[Serializable]
910
public abstract class ParameterOverride
1011
{
1112
/// <summary>

com.unity.postprocessing/PostProcessing/Runtime/PostProcessLayer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ public sealed class SerializedBundleRef
157157
/// <summary>
158158
/// A reference to the bundle itself.
159159
/// </summary>
160+
[NonSerialized]
160161
public PostProcessBundle bundle; // Not serialized, is set/reset when deserialization kicks in
161162
}
162163

0 commit comments

Comments
 (0)