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
Constructors
Name | Description | |
---|---|---|
UxrGrabbableObjectComponent<T> |
Properties
Name | Description | |
---|---|---|
GrabbableObject | Gets the grabbable object component. | |
IsBeingGrabbed | Gets whether the grabbable object is currently being grabbed. | |
IsGrabbableObjectRequired | 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
Name | Description | |
---|---|---|
Awake | Caches the grabbable object component. (Overrides UxrComponent<T>.Awake().) | |
OnDisable | Unsubscribes from events. (Overrides UxrComponent<T>.OnDisable().) | |
OnEnable | Subscribes to events. (Overrides UxrComponent<T>.OnEnable().) | |
OnObjectConstraintsApplied | Overridable event trigger method for the ConstraintsApplied event that can be used to handle it without requiring to subscribe/unsubscribe. | |
OnObjectConstraintsApplying | Overridable event trigger method for the ConstraintsApplying event that can be used to handle it without requiring to subscribe/unsubscribe. | |
OnObjectConstraintsFinished | Overridable event trigger method for the ConstraintsFinished event that can be used to handle it without requiring to subscribe/unsubscribe. | |
OnObjectGrabbed | Overridable event trigger method for the Grabbed event that can be used to handle it without requiring to subscribe/unsubscribe. | |
OnObjectGrabbing | Overridable event trigger method for the Grabbing event that can be used to handle it without requiring to subscribe/unsubscribe. | |
OnObjectPlaced | Overridable event trigger method for the Placed event that can be used to handle it without requiring to subscribe/unsubscribe. | |
OnObjectPlacing | Overridable event trigger method for the Placing event that can be used to handle it without requiring to subscribe/unsubscribe. | |
OnObjectReleased | Overridable event trigger method for the Released event that can be used to handle it without requiring to subscribe/unsubscribe. | |
OnObjectReleasing | Overridable event trigger method for the Releasing event that can be used to handle it without requiring to subscribe/unsubscribe. |
Extension Methods
Name | Description | |
---|---|---|
CheckSetEnabled | Enables/disabled the component if it isn’t enabled already. (Defined by MonoBehaviourExt.) | |
GetOrAddComponent<T> | Gets the Component of a given type. If it doesn’t exist, it is added to the GameObject. (Defined by ComponentExt.) | |
GetPathUnderScene | Gets the full path under current scene, including all parents, but scene name, for the given component. (Defined by ComponentExt.) | |
GetSceneUid | Gets an unique identifier string for the given component. (Defined by ComponentExt.) | |
GetUniqueScenePath | 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.) | |
LoopCoroutine | Creates a coroutine that simplifies executing a loop during a certain amount of time. (Defined by MonoBehaviourExt.) | |
SafeGetComponentInParent<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.) | |
ShowInInspector(Boolean) | Overloaded. Controls whether to show the current object in the inspector. (Defined by ObjectExt.) | |
ShowInInspector(Boolean, Boolean) | Overloaded. Controls whether to show the current object in the inspector and whether it is editable. (Defined by ObjectExt.) | |
ThrowIfNull | Throws an exception if the object is null. (Defined by ObjectExt.) |
See Also
Reference
UltimateXR.Core.Components.Composite Namespace