-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MRKT3] Making custom reticles a bit easier in MRTK3. (#11758)
## Overview The intent of this change is to make attaching a custom reticle easier in MRTK3. The custom reticle is now attached to the base reticle's root transform, removing the need for the custom reticle to position itself. Also, reverting changes made to `RecticleMagnetism`. With this change, `RecticleMagnetisms` once again uses an interface for setting progress, instead of requiring a `RingReticle` component. Also, instead of using the old `IVariableReticle`, `RecticleMagnetisms` is now using `IVariableProgressReticle` to better indicate the propose of the interface. I also rename the newer `IVariableReticle` to `IRecticleVisual` to better indicate its purpose. This change is in response to #11751 ## Changes - Fixes: #11751
- Loading branch information
Showing
13 changed files
with
209 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
com.microsoft.mrtk.core/Interactors/IReticleVisual.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
com.microsoft.mrtk.core/Interactors/IVariableProgressReticle.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.MixedReality.Toolkit | ||
{ | ||
/// <summary> | ||
/// A reticle that is capable of displaying interaction progress. | ||
/// </summary> | ||
/// <remarks> | ||
/// This may be used to show selection progress and touch proximity. | ||
/// </remarks> | ||
/// <seealso cref="VariableProgressReticleUpdateArgs"/> | ||
public interface IVariableProgressReticle | ||
{ | ||
/// <summary> | ||
/// Update the progress of the visual. | ||
/// </summary> | ||
public void UpdateProgress(VariableProgressReticleUpdateArgs args); | ||
} | ||
|
||
/// <summary> | ||
/// A struct to store the arguments passed to <see cref="IVariableProgressReticle.UpdateProgress"/>. | ||
/// </summary> | ||
public struct VariableProgressReticleUpdateArgs | ||
{ | ||
/// <summary> | ||
/// A value from 0 to 1 indicating interaction progress of an. | ||
/// </summary> | ||
/// <remarks> | ||
/// This may be used to show selection progress and touch proximity. | ||
/// </remarks> | ||
public float Progress; | ||
|
||
/// <summary> | ||
/// Initializes a <see cref="VariableReticleUpdateArgs"/> struct. | ||
/// </summary> | ||
public VariableProgressReticleUpdateArgs(float progress) | ||
{ | ||
Progress = progress; | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.