Skip to content

Commit d396f13

Browse files
Improved 2023 Support (#213)
1 parent 6cc5174 commit d396f13

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "com.microsoft.mrtk.graphicstools.shadergraph.unity",
3-
"version": "0.6.5",
3+
"version": "0.7.0",
44
"displayName": "MRTK Graphics Tools Shader Graph",
5-
"description": "Graphics tools and components for developing Mixed Reality applications in Unity Shader Graph.",
5+
"description": "Graphics tools and components for developing Mixed Reality applications in Unity Shader Graph.",
66
"documentationUrl": "https://aka.ms/mrtk3graphics",
77
"msftFeatureCategory": "MRTK3",
88
"unity": "2021.3",

com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ public static bool CaptureScreenshot(string path, int superSize = 1, bool transp
8686

8787
if (camera == null)
8888
{
89+
#if UNITY_2023_1_OR_NEWER
90+
camera = GameObject.FindFirstObjectByType<Camera>();
91+
#else
8992
camera = GameObject.FindObjectOfType<Camera>();
93+
#endif
9094

9195
if (camera == null)
9296
{

com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AcrylicBlurRenderPass : ScriptableRenderPass
1919
{
2020
public bool setMaterialTexture = false;
2121
private string profilerLabel;
22-
#if UNITY_6000_0_OR_NEWER
22+
#if UNITY_2022_1_OR_NEWER
2323
private RTHandle target1;
2424
private RTHandle target2;
2525
#else
@@ -96,7 +96,7 @@ public override void Configure(CommandBuffer cmd, RenderTextureDescriptor camera
9696
}
9797
}
9898

99-
#if UNITY_6000_0_OR_NEWER
99+
#if UNITY_2022_1_OR_NEWER
100100
private static RenderTargetIdentifier GetIdentifier(RTHandle target)
101101
{
102102
return Shader.PropertyToID(target.name);
@@ -117,7 +117,7 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData
117117

118118
var handle = providedTexture==null ? GetIdentifier(target1) : providedTexture;
119119
var renderer = renderingData.cameraData.renderer;
120-
#if UNITY_6000_0_OR_NEWER
120+
#if UNITY_2022_1_OR_NEWER
121121
var colorTargetHandle = renderer.cameraColorTargetHandle;
122122
#else
123123
var colorTargetHandle = renderer.cameraColorTarget;
@@ -198,7 +198,7 @@ private void SwapTempTargets()
198198
target2 = rttmp;
199199
}
200200

201-
#if UNITY_6000_0_OR_NEWER
201+
#if UNITY_2022_1_OR_NEWER
202202
private void ConfigureTempRenderTarget(ref RTHandle target, string id, int width, int height, int slices, CommandBuffer cmd)
203203
{
204204
target = RTHandles.Alloc(id, name: id);

com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ private void OnEnable()
9595
/// </summary>
9696
private void Start()
9797
{
98+
#if UNITY_2023_1_OR_NEWER
99+
SubsystemManager.GetSubsystems(xrDisplaySubsystems);
100+
#else
98101
SubsystemManager.GetInstances(xrDisplaySubsystems);
102+
#endif
99103
}
100104

101105
/// <summary>

com.microsoft.mrtk.graphicstools.unity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.microsoft.mrtk.graphicstools.unity",
3-
"version": "0.6.9",
3+
"version": "0.7.0",
44
"displayName": "MRTK Graphics Tools",
55
"description": "Graphics tools and components for developing Mixed Reality applications in Unity.",
66
"documentationUrl": "https://aka.ms/mrtk3graphics",

0 commit comments

Comments
 (0)