UxrGrabbableObjectComponent<T> Class

Generic base class for components belonging to an object that also has a UxrGrabbableObject or in any of its parents. It allows to leverage some of the work related to accessing the UxrGrabbableObject component and processing the events without the need to subscribe or unsubscribe to them. Instead, events can be processed by overriding the different event triggers (OnXXX methods). The component has also all the benefits derived from UxrComponent.

Inheritance Hierarchy

System.Object
  Object
    Component
      Behaviour
        MonoBehaviour
          UltimateXR.Core.Components.UxrComponent
            UltimateXR.Core.Components.UxrComponent<T>
              UltimateXR.Core.Components.Composite.UxrGrabbableObjectComponent<T>
                More… Namespace: UltimateXR.Core.Components.Composite
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

[RequireComponent(typeof(UxrGrabbableObject))]
public abstract class UxrGrabbableObjectComponent<T> : UxrComponent<T>
where T : UxrGrabbableObjectComponent<T>


Type Parameters

 

T
Component type
  The UxrGrabbableObjectComponent<T> type exposes the following members.

Constructors

NameDescription
Protected methodUxrGrabbableObjectComponent<T>

Properties

NameDescription
Public propertyGrabbableObject Gets the grabbable object component.
Public propertyIsBeingGrabbed Gets whether the grabbable object is currently being grabbed.
Protected propertyIsGrabbableObjectRequired Gets whether the grabbable object component is required or it’s not. By default it is required but it can be overriden in child classes so that it is optional.

Methods

NameDescription
Protected methodAwake Caches the grabbable object component. (Overrides UxrComponent<T>.Awake().)
Protected methodOnDisable Unsubscribes from events. (Overrides UxrComponent<T>.OnDisable().)
Protected methodOnEnable Subscribes to events. (Overrides UxrComponent<T>.OnEnable().)
Protected methodOnObjectConstraintsApplied Overridable event trigger method for the ConstraintsApplied event that can be used to handle it without requiring to subscribe/unsubscribe.
Protected methodOnObjectConstraintsApplying Overridable event trigger method for the ConstraintsApplying event that can be used to handle it without requiring to subscribe/unsubscribe.
Protected methodOnObjectConstraintsFinished Overridable event trigger method for the ConstraintsFinished event that can be used to handle it without requiring to subscribe/unsubscribe.
Protected methodOnObjectGrabbed Overridable event trigger method for the Grabbed event that can be used to handle it without requiring to subscribe/unsubscribe.
Protected methodOnObjectGrabbing Overridable event trigger method for the Grabbing event that can be used to handle it without requiring to subscribe/unsubscribe.
Protected methodOnObjectPlaced Overridable event trigger method for the Placed event that can be used to handle it without requiring to subscribe/unsubscribe.
Protected methodOnObjectPlacing Overridable event trigger method for the Placing event that can be used to handle it without requiring to subscribe/unsubscribe.
Protected methodOnObjectReleased Overridable event trigger method for the Released event that can be used to handle it without requiring to subscribe/unsubscribe.
Protected methodOnObjectReleasing Overridable event trigger method for the Releasing event that can be used to handle it without requiring to subscribe/unsubscribe.

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.Core.Components.Composite Namespace

Inheritance HierarchySystem.Object
  Object
    Component
      Behaviour
        MonoBehaviour
          UltimateXR.Core.Components.UxrComponent
            UltimateXR.Core.Components.UxrComponent<T>
              UltimateXR.Core.Components.Composite.UxrGrabbableObjectComponent<T>
                UltimateXR.Devices.Visualization.UxrMapControllerToHand
                UltimateXR.Haptics.Helpers.UxrHapticOnImpact
                UltimateXR.Haptics.Helpers.UxrManipulationHapticFeedback
                UltimateXR.Manipulation.Helpers.UxrDependentGrabbable
                UltimateXR.Manipulation.Helpers.UxrReturnGrabbableObject
                UltimateXR.Mechanics.Weapons.UxrProjectileDeflect
                UltimateXR.Mechanics.Weapons.UxrWeapon