Skip to content

Commit 27a49f8

Browse files
committed
5.0.1 compat
1 parent e514617 commit 27a49f8

File tree

10 files changed

+24
-24
lines changed

10 files changed

+24
-24
lines changed

ZEDCamera/Assets/Editor/Scripts/RenderingPipelineDefines.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ static void UpdateDefines()
5353
static PipelineType GetPipeline()
5454
{
5555
#if UNITY_2019_1_OR_NEWER
56-
if (GraphicsSettings.renderPipelineAsset != null)
56+
if (GraphicsSettings.defaultRenderPipeline != null)
5757
{
5858
// SRP
59-
var srpType = GraphicsSettings.renderPipelineAsset.GetType().ToString();
59+
var srpType = GraphicsSettings.defaultRenderPipeline.GetType().ToString();
6060
if (srpType.Contains("HDRenderPipelineAsset"))
6161
{
6262
return PipelineType.HDPipeline;

ZEDCamera/Assets/SDK/Helpers/Scripts/Utilities/UpgradePluginToSRP.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ public static class UpgradePluginToSRP
55
{
66
public static bool UpgradeCameraToSRP(GameObject zedCam)
77
{
8-
var SRP = GraphicsSettings.renderPipelineAsset;
8+
var SRP = GraphicsSettings.defaultRenderPipeline;
99

10-
if (GraphicsSettings.renderPipelineAsset != null)
10+
if (GraphicsSettings.defaultRenderPipeline != null)
1111
{
1212
var SRPString = SRP.GetType().ToString();
1313
if (SRPString.Contains("UniversalRenderPipelineAsset"))
@@ -64,9 +64,9 @@ public static bool UpgradeCameraToSRP(GameObject zedCam)
6464

6565
public static bool UpgradeGreenScreenToSRP(GameObject greenScreen)
6666
{
67-
var SRP = GraphicsSettings.renderPipelineAsset;
67+
var SRP = GraphicsSettings.defaultRenderPipeline;
6868

69-
if (GraphicsSettings.renderPipelineAsset != null)
69+
if (GraphicsSettings.defaultRenderPipeline != null)
7070
{
7171
var SRPString = SRP.GetType().ToString();
7272
if (SRPString.Contains("UniversalRenderPipelineAsset"))
@@ -115,9 +115,9 @@ public static bool UpgradeGreenScreenToSRP(GameObject greenScreen)
115115

116116
public static bool UpgradePlanetariumToSRP(GameObject planetarium)
117117
{
118-
var SRP = GraphicsSettings.renderPipelineAsset;
118+
var SRP = GraphicsSettings.defaultRenderPipeline;
119119

120-
if (GraphicsSettings.renderPipelineAsset != null)
120+
if (GraphicsSettings.defaultRenderPipeline != null)
121121
{
122122
var SRPString = SRP.GetType().ToString();
123123
if (SRPString.Contains("UniversalRenderPipelineAsset"))

ZEDCamera/Assets/SDK/Helpers/Scripts/Utilities/ZEDSupportFunctions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static bool hasXRDevice()
3131
if (xRLoader.name == "OculusLoader" || xRLoader.name == "OpenVRLoader")
3232
{
3333
var xrDisplaySubsystems = new List<XRDisplaySubsystem>();
34-
SubsystemManager.GetInstances<XRDisplaySubsystem>(xrDisplaySubsystems);
34+
SubsystemManager.GetSubsystems<XRDisplaySubsystem>(xrDisplaySubsystems);
3535
foreach (var xrDisplay in xrDisplaySubsystems)
3636
{
3737
if (xrDisplay.running)
2.5 KB
Binary file not shown.

ZEDCamera/Assets/Samples~/Mixed Reality Calibration/Scripts/BellyMenu.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ void FixedUpdate ()
8686
}
8787
else if (posdiff.magnitude < moveDeadzoneMeters / 2f) //Too close. Slow down extra fast.
8888
{
89-
_rb.velocity *= 0.9f;
90-
if (_rb.velocity.magnitude < 0.05f) _rb.velocity = Vector3.zero;
89+
_rb.linearVelocity *= 0.9f;
90+
if (_rb.linearVelocity.magnitude < 0.05f) _rb.linearVelocity = Vector3.zero;
9191
}
9292
}
9393
else //Not gradual move.

ZEDCamera/Assets/Samples~/Mixed Reality Calibration/Scripts/ForceTrackingSpaceType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class ForceTrackingSpaceType : MonoBehaviour
1616
void Start()
1717
{
1818
List<XRInputSubsystem> subsystems = new List<XRInputSubsystem>();
19-
SubsystemManager.GetInstances<XRInputSubsystem>(subsystems);
19+
SubsystemManager.GetSubsystems<XRInputSubsystem>(subsystems);
2020
for (int i = 0; i < subsystems.Count; i++)
2121
{
2222
subsystems[i].TrySetTrackingOriginMode(TrackingOriginModeFlags.Floor);

ZEDCamera/Assets/Samples~/Plane Detection/Scripts/Bunny.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public void SetMySpawner(BunnySpawner spawner)
8383
/// </summary>
8484
public void GetHit(bool hit)
8585
{
86-
GetComponent<Rigidbody>().drag = 0f;
87-
GetComponent<Rigidbody>().angularDrag = 0.5f;
86+
GetComponent<Rigidbody>().linearDamping = 0f;
87+
GetComponent<Rigidbody>().angularDamping = 0.5f;
8888
StartCoroutine(HitDelay(hit));
8989
}
9090

@@ -126,8 +126,8 @@ private void FixedUpdate()
126126
if (IsMoving)
127127
{
128128
//Look for our next position based on our current velocity.
129-
Vector3 predictedPos = centerpoint.position + (rb.velocity * (Time.deltaTime * 2.5f));
130-
transform.rotation = Quaternion.LookRotation(rb.velocity.normalized);
129+
Vector3 predictedPos = centerpoint.position + (rb.linearVelocity * (Time.deltaTime * 2.5f));
130+
transform.rotation = Quaternion.LookRotation(rb.linearVelocity.normalized);
131131

132132
//Collision check with the real world at that next position.
133133
foreach (ZEDManager manager in ZEDManager.GetInstances()) //Check all active cameras.
@@ -144,7 +144,7 @@ private void FixedUpdate()
144144
{
145145
IsMoving = false; //Not moving anymore, so update our state.
146146
bunnyspawner.SpawnUI(predictedPos); //Start spawning the UI on our current location.
147-
rb.velocity = Vector3.Reflect(rb.velocity / 2, transform.forward); //Bounce off the surface we hit
147+
rb.linearVelocity = Vector3.Reflect(rb.linearVelocity / 2, transform.forward); //Bounce off the surface we hit
148148
}
149149

150150
break; //If it hit the real world in one camera's view, no need to check the other cameras.

ZEDCamera/Assets/Samples~/Plane Detection/Scripts/CapsuleFollower.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private void FixedUpdate()
6666

6767
velocity = (destination - rb.transform.position) * sensitivity;
6868

69-
rb.velocity = velocity;
69+
rb.linearVelocity = velocity;
7070
}
7171

7272
/// <summary>
@@ -82,19 +82,19 @@ private void OnTriggerEnter(Collider other)
8282
{
8383
if (other.GetComponent<Rigidbody>() && !colBunny.IsMoving)
8484
{
85-
if (rb.velocity.y <= -2)
85+
if (rb.linearVelocity.y <= -2)
8686
{
8787
colBunny.anim.SetTrigger("Squeeze");
8888
colBunny.GetHit(hit: false);
8989
}
90-
else if (rb.velocity.magnitude > 2f)
90+
else if (rb.linearVelocity.magnitude > 2f)
9191
{
9292
//Send a call to GetHit() which delays for X seconds the Bunny's detection with the real world.
9393
//Since the Bunny is already on the floor, it might return true for collision the moment the baseball bat touches it.
9494
colBunny.GetHit(hit: true);
9595

9696
//Assign our velocity with some changes. Halving the velocity makes it feel more natural when hitting the bunny.
97-
other.GetComponent<Rigidbody>().velocity = rb.velocity / 2;
97+
other.GetComponent<Rigidbody>().linearVelocity = rb.linearVelocity / 2;
9898
}
9999
}
100100
}

ZEDCamera/Assets/Samples~/Spatial Mapping/Scripts/BallLauncher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void Update()
143143
launcher.transform.localRotation = Quaternion.Euler(-offsetAngleY * Mathf.Rad2Deg, -offsetAngleX * Mathf.Rad2Deg, 0);
144144
projectiles[countsphere % SPHERE_NB].GetComponent<BallTrigger>().ResetValues();
145145
Rigidbody rigidBody = projectiles[countsphere % SPHERE_NB].GetComponent<Rigidbody>();
146-
rigidBody.velocity = Vector3.zero;
146+
rigidBody.linearVelocity = Vector3.zero;
147147
rigidBody.isKinematic = false;
148148
rigidBody.useGravity = true;
149149

ZEDCamera/Assets/Samples~/Spatial Mapping/Scripts/BallTrigger.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ public void ResetValues()
2424

2525
void OnTriggerEnter(Collider other)
2626
{
27-
if (hasDamaged || body.velocity.magnitude < minVelocityDammage) return;
27+
if (hasDamaged || body.linearVelocity.magnitude < minVelocityDammage) return;
2828
if (other.gameObject.name.Contains("ZomBunny"))
2929
{
3030
hasDamaged = true;
31-
other.gameObject.GetComponent<EnemyBehavior>().Dammage(dammage * body.velocity.magnitude);
31+
other.gameObject.GetComponent<EnemyBehavior>().Dammage(dammage * body.linearVelocity.magnitude);
3232
}
3333
}
3434
}

0 commit comments

Comments
 (0)