Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Code and Fixed Some Warning ⚠ #10526

Merged
merged 20 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9024d40
Update Code And Fixed Some Warning ⚠
BillyFrcs Apr 5, 2022
efb035b
Revert switch target result.
BillyFrcs Apr 6, 2022
b513e37
Update Tracking Object
BillyFrcs Apr 28, 2022
31004f2
Merge branch 'microsoft:main' into UpdateCode-And-FixWarning
BillyFrcs Apr 28, 2022
5a71231
Merge branch 'microsoft:main' into UpdateCode-And-FixWarning
BillyFrcs Apr 28, 2022
3fd1940
Merge branch 'microsoft:main' into UpdateCode-And-FixWarning
BillyFrcs May 1, 2022
23b401b
Merge branch 'microsoft:main' into UpdateCode-And-FixWarning
BillyFrcs May 9, 2022
ab83fed
Revert SetCursor() Method to avoid breaking API
BillyFrcs May 20, 2022
e98c671
Merge branch 'microsoft:main' into UpdateCode-And-FixWarning
BillyFrcs May 20, 2022
100e893
Merge branch 'microsoft:main' into UpdateCode-And-FixWarning
BillyFrcs May 24, 2022
eef926e
Revert private/protected fields to public
BillyFrcs May 24, 2022
40fd6ea
Merge branch 'prerelease/2.8.0' into UpdateCode-And-FixWarning
BillyFrcs May 24, 2022
0da0cb3
Fix SetCursor()
BillyFrcs May 25, 2022
9224c98
Update Assets/MRTK/SDK/Features/UX/Scripts/Pointers/ShellHandRayPoint…
BillyFrcs May 25, 2022
0a267e7
Update TeleportPointer.cs
BillyFrcs May 26, 2022
c3c7547
Merge branch 'main' into UpdateCode-And-FixWarning
BillyFrcs May 28, 2022
3374386
Merge branch 'microsoft:main' into UpdateCode-And-FixWarning
BillyFrcs Jun 15, 2022
def8aa4
Merge branch 'microsoft:main' into UpdateCode-And-FixWarning
BillyFrcs Jun 18, 2022
fb7d001
Merge branch 'microsoft:main' into UpdateCode-And-FixWarning
BillyFrcs Jun 20, 2022
e583c20
Update LoaderController.cs
BillyFrcs Jun 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keveleigh is the != null check necessary here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be, since we do it after we call IsActiveLoader.HasValue without a null check in the previous line.

{
Enable();
}
Expand Down
10 changes: 5 additions & 5 deletions Assets/MRTK/SDK/Features/UX/Scripts/HandCoach/MoveToTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public GameObject TrackingObject
/// <summary>
/// Target to move to.
/// </summary>
public GameObject TargetObject
private GameObject TargetObject
{
get
{
Expand All @@ -54,7 +54,7 @@ public GameObject TargetObject
/// <summary>
/// Shared parent between tracking and target objects used for relative local positions.
/// </summary>
public GameObject RootObject
private GameObject RootObject
{
get
{
Expand All @@ -73,7 +73,7 @@ public GameObject RootObject
/// <summary>
/// Duration of move from tracking object to target object in seconds.
/// </summary>
public float Duration
private float Duration
{
get
{
Expand All @@ -92,7 +92,7 @@ public float Duration
/// <summary>
/// Tunable offset to get the GameObject to arrive at the right target position.
/// </summary>
public Vector3 TargetOffset
private Vector3 TargetOffset
{
get
{
Expand All @@ -111,7 +111,7 @@ public Vector3 TargetOffset
/// <summary>
/// Lerp curve that controls the animation position over time from the trackingObject to the targetObject.
/// </summary>
public AnimationCurve AnimationCurve
private AnimationCurve AnimationCurve
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class RotateAroundPoint : MonoBehaviour
/// <summary>
/// Parent object centered at rotation center.
/// </summary>
public Transform CenteredParent
private Transform CenteredParent
{
get
{
Expand All @@ -34,7 +34,7 @@ public Transform CenteredParent
/// <summary>
/// Hand hint parent to rotate inverse to centeredParent to keep hand orientation the same.
/// </summary>
public Transform InverseParent
private Transform InverseParent
{
get
{
Expand All @@ -53,7 +53,7 @@ public Transform InverseParent
/// <summary>
/// Point to start movement at.
/// </summary>
public Transform PivotPosition
private Transform PivotPosition
{
get
{
Expand All @@ -72,7 +72,7 @@ public Transform PivotPosition
/// <summary>
/// Duration of rotation around the CenteredParent in seconds.
/// </summary>
public float Duration
private float Duration
{
get
{
Expand All @@ -91,7 +91,7 @@ public float Duration
/// <summary>
/// Lerp curve that controls the animation rotation over time.
/// </summary>
public AnimationCurve AnimationCurve
private AnimationCurve AnimationCurve
{
get
{
Expand All @@ -110,7 +110,7 @@ public AnimationCurve AnimationCurve
/// <summary>
/// How many degrees to rotate along each axis.
/// </summary>
public Vector3 RotationVector
private Vector3 RotationVector
{
get
{
Expand Down
10 changes: 2 additions & 8 deletions Assets/MRTK/SDK/Features/UX/Scripts/Loader/LoaderController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,8 @@ private float Cycles
{
return (frequency < 0.0f) ? (Time.time / 0.000001f) * -1.0f : (Time.time / frequency) * -1.0f;
}
else
{
return (frequency < 0.0f) ? Time.time / 0.000001f : Time.time / frequency;
}

return (frequency < 0.0f) ? Time.time / 0.000001f : Time.time / frequency;
RogPodge marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand All @@ -209,13 +207,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
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public abstract class BaseControllerPointer : ControllerPoseSynchronizer, IMixed
/// </summary>
/// <remarks>This <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> must have a <see cref="Microsoft.MixedReality.Toolkit.Input.IMixedRealityCursor"/> attached to it.</remarks>
/// <param name="newCursor">The new cursor</param>
public virtual void SetCursor(GameObject newCursor = null)
RogPodge marked this conversation as resolved.
Show resolved Hide resolved
private void SetCursor(GameObject newCursor = null)
RogPodge marked this conversation as resolved.
Show resolved Hide resolved
{
using (SetCursorPerfMarker.Auto())
{
Expand Down Expand Up @@ -340,7 +340,7 @@ public virtual bool IsInteractionEnabled
/// <summary>
/// Maximum distance at which all pointers can collide with a <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see>, unless it has an override extent.
/// </summary>
public float PointerExtent
protected float PointerExtent
{
get
{
Expand Down Expand Up @@ -368,7 +368,7 @@ public float PointerExtent
/// <summary>
/// The length of the pointer when nothing is hit.
/// </summary>
public float DefaultPointerExtent
protected float DefaultPointerExtent
{
get => Mathf.Min(defaultPointerExtent, PointerExtent);
set => defaultPointerExtent = value;
Expand All @@ -389,7 +389,7 @@ public float DefaultPointerExtent
/// <summary>
/// Ray stabilizer used when calculating position of pointer end point.
/// </summary>
public IBaseRayStabilizer RayStabilizer { get; set; }
protected IBaseRayStabilizer RayStabilizer { get; set; }

/// <inheritdoc />
public virtual SceneQueryType SceneQueryType { get; set; } = SceneQueryType.SimpleRaycast;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,15 @@ public override void OnPostSceneQuery()
wasGrabPressed = IsGrabPressed;

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

for (int i = 0; i < LineRenderers.Length; i++)
BillyFrcs marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -232,7 +232,7 @@ protected override async void Start()
}
}
lateRegisterTeleport = false;
CoreServices.TeleportSystem.RegisterHandler<IMixedRealityTeleportHandler>(this);
CoreServices.TeleportSystem?.RegisterHandler<IMixedRealityTeleportHandler>(this);
}
}

Expand All @@ -245,15 +245,15 @@ protected override void OnDisable()

private Vector2 currentInputPosition = Vector2.zero;

protected bool isTeleportRequestActive = false;
private bool isTeleportRequestActive = false;

private bool lateRegisterTeleport = true;

private bool canTeleport = false;

private bool canMove = false;

protected Gradient GetLineGradient(TeleportSurfaceResult targetResult)
private Gradient GetLineGradient(TeleportSurfaceResult targetResult)
RogPodge marked this conversation as resolved.
Show resolved Hide resolved
{
switch (targetResult)
{
Expand Down