UxrGrabbableObjectAnchor Class

Component that, added to a GameObject, will enable UxrGrabbableObject objects to be placed on it. Some of the main features of grabbable object anchors are:  

Inheritance Hierarchy

System.Object
  Object
    Component
      Behaviour
        MonoBehaviour
          UltimateXR.Core.Components.UxrComponent
            UltimateXR.Core.Components.UxrComponent(UxrGrabbableObjectAnchor)
              UltimateXR.Manipulation.UxrGrabbableObjectAnchor
Namespace: UltimateXR.Manipulation
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

public class UxrGrabbableObjectAnchor : UxrComponent<UxrGrabbableObjectAnchor>


The UxrGrabbableObjectAnchor type exposes the following members.

Constructors

NameDescription
Public methodUxrGrabbableObjectAnchor

Properties

NameDescription
Public propertyActivateOnCompatibleNear Gets or sets the object that will be enabled or disabled depending on if there is a grabbed compatible UxrGrabbableObject close enough to be placed on it.
Public propertyActivateOnCompatibleNotNear Gets or sets the object that will be enabled or disabled depending on if there isn’t a grabbed compatible UxrGrabbableObject close enough to be placed on it.
Public propertyActivateOnEmpty Gets or sets the object that will be enabled or disabled depending on if there isn’t a UxrGrabbableObject currently placed on the anchor.
Public propertyActivateOnHandNearAndGrabbable Gets or sets the object that will be enabled or disabled depending on if there is a UxrGrabbableObject currently placed on the anchor and a UxrGrabber close enough to grab it.
Public propertyActivateOnPlaced Gets or sets the object that will be enabled or disabled depending on if there is a UxrGrabbableObject currently placed on the anchor.
Public propertyAlignTransform Gets the Transform that will be used to snap the UxrGrabbableObject placed on it.
Public propertyCurrentPlacedObject Gets the UxrGrabbableObject that is currently placed on the anchor.
Public propertyDropProximityTransform Gets the Transform that will be used to compute the distance to UxrGrabbableObject that can be placed on it, in order to determine if they are close enough.
Public propertyMaxPlaceDistance Gets or sets the maximum distance from which an object that is released will be placed on the anchor.

Methods

NameDescription
Public methodAddCompatibleTags Adds compatible tags to the list of compatible tags that control which objects can be placed on the anchor.
Public methodAddPlacingValidator Adds a placing validator to the internal list of validators. Placing validators are functions that are used in addition to compatibility tags in order to determine if a UxrGrabbableObject can be placed on the anchor. An object can be placed on an anchor if the tag is compatible and if it is allowed by all of the placing validators.
Protected methodAwake Initializes the component. (Overrides UxrComponent<T>.Awake().)
Public methodIsCompatibleObject Checks whether the given UxrGrabbableObject is compatible with the anchor, which means that it can potentially be placed on it if there is no other object placed.
Protected methodOnDestroy Removes the validators. (Overrides UxrComponent<T>.OnDestroy().)
Public methodRemoveCompatibleTags Removes compatible tags from the list of compatible tags that control which objects can be placed on the anchor.
Public methodRemoveObject Removes the currently placed object, if there is any, from the anchor.
Public methodRemovePlacingValidator Removes a placing validator added using AddPlacingValidator(Func(UxrGrabbableObject, Boolean)).
Protected methodStart Performs additional initialization. (Overrides UxrComponent.Start().)

Events

NameDescription
Public eventPlaced Event called right after an object was placed on the anchor.
Public eventPlacing Event called right before an object is placed on the anchor.
Public eventRemoved Event called right after the currently placed object is removed from the anchor.
Public eventRemoving Event called right before the currently placed object is removed from the anchor.
Public eventSmoothPlaceTransitionEnded Event called right after an object that was placed on the anchor ended its smooth placing transition.

Extension Methods

NameDescription
Public Extension MethodCheckSetEnabled Enables/disabled the component if it isn’t enabled already. (Defined by MonoBehaviourExt.)
Public Extension MethodGetOrAddComponent<T> Gets the Component of a given type. If it doesn’t exist, it is added to the GameObject. (Defined by ComponentExt.)
Public Extension MethodGetPathUnderScene Gets the full path under current scene, including all parents, but scene name, for the given component. (Defined by ComponentExt.)
Public Extension MethodGetSceneUid Gets an unique identifier string for the given component. (Defined by ComponentExt.)
Public Extension MethodGetUniqueScenePath Gets an unique path in the scene for the given component. It will include scene name, sibling and component indices to make it unique. (Defined by ComponentExt.)
Public Extension MethodLoopCoroutine Creates a coroutine that simplifies executing a loop during a certain amount of time. (Defined by MonoBehaviourExt.)
Public Extension MethodSafeGetComponentInParent<T> Gets the Component of a given type in the GameObject or any of its parents. It also works on prefabs, where regular GetComponentInParent(Type, Boolean) will not work: https://issuetracker.unity3d.com/issues/getcomponentinparent-is-returning-null-when-the-gameobject-is-a-prefab (Defined by ComponentExt.)
Public Extension MethodShowInInspector(Boolean)Overloaded.
Controls whether to show the current object in the inspector. (Defined by ObjectExt.)
Public Extension MethodShowInInspector(Boolean, Boolean)Overloaded.
Controls whether to show the current object in the inspector and whether it is editable. (Defined by ObjectExt.)
Public Extension MethodThrowIfNull Throws an exception if the object is null. (Defined by ObjectExt.)

See Also

Reference

UltimateXR.Manipulation Namespace