Skip to content

Commit

Permalink
Update Code and Fixed Some Warning ⚠ (#10526)
Browse files Browse the repository at this point in the history
* Update Code And Fixed Some Warning ⚠

* Revert switch target result.

* Update Tracking Object

* Revert SetCursor() Method to avoid breaking API

* Revert private/protected fields to public

* Fix SetCursor()

* Update Assets/MRTK/SDK/Features/UX/Scripts/Pointers/ShellHandRayPointer.cs

Co-authored-by: Kurtis <kurtie@microsoft.com>

* Update TeleportPointer.cs

* Update LoaderController.cs

Co-authored-by: Kurtis <kurtie@microsoft.com>
  • Loading branch information
BillyFrcs and keveleigh committed Jun 21, 2022
1 parent 72e283d commit ec6cbf1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ public override void Enable()
EnableIfLoaderBecomesActive();
return;
}
else if (!IsActiveLoader.Value)

if (!IsActiveLoader.Value)
{
IsEnabled = false;
return;
Expand All @@ -96,7 +97,7 @@ public override void Enable()
private async void EnableIfLoaderBecomesActive()
{
await new WaitUntil(() => IsActiveLoader.HasValue);
if (IsActiveLoader.Value)
if (IsActiveLoader != null && IsActiveLoader.Value)
{
Enable();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,4 @@ private IEnumerator RotateHintSequence()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,9 @@ private float Cycles

private Transform dot01;
private Vector3 dot01NewPos = Vector3.zero;
private Vector3 dot01NewScale = Vector3.zero;
private Vector3 dot01NewRot = Vector3.zero;

private Transform dot02;
private Vector3 dot02NewPos = Vector3.zero;
private Vector3 dot02NewScale = Vector3.zero;
private Vector3 dot02NewRot = Vector3.zero;

private const float tau = Mathf.PI * 2.0f;

Expand Down Expand Up @@ -295,4 +291,4 @@ private void AnimateDotTransforms()
dot02.transform.localPosition = dot02NewPos;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,14 @@ public override void OnPostSceneQuery()
wasGrabPressed = IsGrabPressed;

var currentMaterial = IsSelectPressed || IsGrabPressed ? lineMaterialSelected : lineMaterialNoTarget;

for (int i = 0; i < LineRenderers.Length; i++)
foreach (var lr in LineRenderers)
{
var lineRenderer = LineRenderers[i] as MixedRealityLineRenderer;
lineRenderer.LineMaterial = currentMaterial;
var lineRenderer = lr as MixedRealityLineRenderer;

if (lineRenderer != null)
{
lineRenderer.LineMaterial = currentMaterial;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public override LayerMask[] PrioritizedLayerMasksOverride

protected LayerMask InvalidTeleportationLayers
{
get
get
{
LayerMask raycastedLayerMasks = new LayerMask();
for (int i = 0; i < PrioritizedLayerMasksOverride.Length; i++)
Expand All @@ -140,7 +140,7 @@ protected LayerMask InvalidTeleportationLayers
}
return ~ValidTeleportationLayers & raycastedLayerMasks;
}
}
}

[SerializeField]
private DistorterGravity gravityDistorter = null;
Expand Down Expand Up @@ -232,7 +232,7 @@ protected override async void Start()
}
}
lateRegisterTeleport = false;
CoreServices.TeleportSystem.RegisterHandler<IMixedRealityTeleportHandler>(this);
CoreServices.TeleportSystem?.RegisterHandler<IMixedRealityTeleportHandler>(this);
}
}

Expand Down

0 comments on commit ec6cbf1

Please sign in to comment.