Scalable Grab Interactable - eisclimber/ExPresS-XR GitHub Wiki

Scalable Grab Interactable

The script has been deprecated and was replaced with a combination of the ExPresS XR Grab Interactable. To maintain compatibility the script extends from the ExPresS XR Grab Interactable since it implements a subset of its functions.

class in ExPresSXR.Interaction / Extends ExPresSXR.Rig.XRGrabInteractable
Component added via Component Menu

Description

Acts as a wrapper for allowing XRGrabInteractables to be scaled while being held.

This will not scale the GameObject itself but all of it's children. Scaling will be linear and is only applied to the children using their initial scale.

Members

Editor Properties

  • float _minScale: Minimal scale possible, negative values are considered unbound. Default: -1.0f
  • float _maxScale: Maximal scale possible, negative values are considered unbound. Default: -1.0f
  • bool _resetScaleInSockets: If the interactable should reset its scale when selected by a socket or retain the current scale.

Public Properties

  • float scaleFactor: The current scale to the children, relative to their initial scale.
  • float scaleSpeedOverride: Override to the scale speed of the ScalingRayInteractor or ScalingDirectInteractor. It is recommended to change the scale speed in the interactors themselves and use this override sparingly.
  • bool scaleAllChildren: If all children should be scaled or only those set as scaledChildren via the editor. Default: true
  • Transform[] scaledChildren: Children affected by scaling. Setting this value during runtime will use the current scales as initial scale.
  • Vector3[] initialScales: (Readonly) The initial scales of the object in _scaledChildren. Only available at runtime.
  • bool hasScaleSpeedOverride: (Readonly) If the interactable has a speed scale override.

Protected Methods

  • void OnEnable(): Performs general setup for the interactable, load the initial scales and connects the scale reset event.
  • void OnDisable(): Performs general teardown for the interactable and disconnects the scale reset event.
  • void ResetScale(): Resets the scale of all (scaled) children to 1.0f.
⚠️ **GitHub.com Fallback** ⚠️