Skip to content

Commit

Permalink
Merge pull request #48 from ExtendRealityLtd/feat/expose-deselect
Browse files Browse the repository at this point in the history
feat(Facade): expose SpatialTarget Deselect method for easy access
  • Loading branch information
thestonefox authored Dec 7, 2020
2 parents f9d4cb0 + cfa6144 commit b0b7978
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Documentation/API/SpatialTargetFacade.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The public interface into the SpatialTarget Prefab.
* [UseSourcePointOverride]
* [UseTargetOverride]
* [Methods]
* [Deselect(Boolean)]
* [OnAfterActionOnHoverChange()]
* [OnAfterActionOnSelectChange()]
* [OnAfterIsEnabledChange()]
Expand Down Expand Up @@ -183,6 +184,22 @@ public bool UseTargetOverride { get; set; }

### Methods

#### Deselect(Boolean)

Deselects the containing [SpatialTarget] if it is in a selected state.

##### Declaration

```
public virtual void Deselect(bool keepInActivatingDispatcher = false)
```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.Boolean | keepInActivatingDispatcher | Whether to keep this in the ActivatingDispatcher.SelectedTargets collection. |

#### OnAfterActionOnHoverChange()

Called after [ActionsOnHover] has been changed.
Expand Down Expand Up @@ -249,6 +266,7 @@ protected virtual void OnAfterUseTargetOverrideChange()
[SpatialTargetFacade.HoverActions]: SpatialTargetFacade.HoverActions.md
[SpatialTargetConfigurator]: SpatialTargetConfigurator.md
[SpatialTargetFacade]: SpatialTargetFacade.md
[SpatialTarget]: SpatialTarget.md
[ActionsOnHover]: SpatialTargetFacade.md#ActionsOnHover
[ActionsOnActivate]: SpatialTargetFacade.md#ActionsOnActivate
[IsEnabled]: SpatialTargetFacade.md#IsEnabled
Expand All @@ -274,6 +292,7 @@ protected virtual void OnAfterUseTargetOverrideChange()
[UseSourcePointOverride]: #UseSourcePointOverride
[UseTargetOverride]: #UseTargetOverride
[Methods]: #Methods
[Deselect(Boolean)]: #DeselectBoolean
[OnAfterActionOnHoverChange()]: #OnAfterActionOnHoverChange
[OnAfterActionOnSelectChange()]: #OnAfterActionOnSelectChange
[OnAfterIsEnabledChange()]: #OnAfterIsEnabledChange
Expand Down
9 changes: 9 additions & 0 deletions Runtime/SharedResources/Scripts/SpatialTargetFacade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@ public enum ActivationActions
public SpatialTargetConfigurator Configuration { get; protected set; }
#endregion

/// <summary>
/// Deselects the containing <see cref="SpatialTarget"/> if it is in a selected state.
/// </summary>
/// <param name="keepInActivatingDispatcher">Whether to keep this in the <see cref="ActivatingDispatcher.SelectedTargets"/> collection.</param>
public virtual void Deselect(bool keepInActivatingDispatcher = false)
{
Configuration.TargetController.DoDeselect(keepInActivatingDispatcher);
}

/// <summary>
/// Called after <see cref="IsEnabled"/> has been changed.
/// </summary>
Expand Down

0 comments on commit b0b7978

Please sign in to comment.