VR Interaction Framework v2.0
Loading...
Searching...
No Matches
BNG.SnapZone Class Reference
Inheritance diagram for BNG.SnapZone:

Public Member Functions

virtual void GrabGrabbable (Grabbable grab)
 
virtual void GrabEquipped (Grabber grabber)
 This is typically called by the GrabAction on the SnapZone.
 
virtual bool CanBeRemoved ()
 
virtual void ReleaseAll ()
 Release everything snapped to us.
 

Public Attributes

Grabbable HeldItem
 
Grabbable StartingItem
 
bool CanDropItem = true
 If false, Item will Move back to inventory space if player drops it.
 
bool CanSwapItem = true
 If false the snap zone cannot have it's content replaced.
 
bool CanRemoveItem = true
 If false the item inside the snap zone may not be removed.
 
float ScaleItem = 1f
 Multiply Item Scale times this when in snap zone.
 
bool DisableColliders = true
 
bool DuplicateItemOnGrab = false
 
float MaxDropTime = 0.1f
 Only snap if Grabbable was dropped maximum of X seconds ago.
 
float LastSnapTime
 Last Time.time this item was snapped into.
 
List< string > OnlyAllowNames
 If not empty, can only snap objects if transform name contains one of these strings.
 
List< string > ExcludeTransformNames
 Do not allow snapping if transform contains one of these names.
 
AudioClip SoundOnSnap
 
AudioClip SoundOnUnsnap
 
GrabbableEvent OnSnapEvent
 Optional Unity Event to be called when something is snapped to this SnapZone. Passes in the Grabbable that was attached.
 
GrabbableEvent OnDetachEvent
 Optional Unity Event to be called when something has been detached from this SnapZone. Passes in the Grabbable is being detattached.
 
Grabbable ClosestGrabbable
 

Member Function Documentation

◆ CanBeRemoved()

virtual bool BNG.SnapZone.CanBeRemoved ( )
virtual

◆ GrabEquipped()

virtual void BNG.SnapZone.GrabEquipped ( Grabber  grabber)
virtual

This is typically called by the GrabAction on the SnapZone.

Parameters
grabber

◆ GrabGrabbable()

virtual void BNG.SnapZone.GrabGrabbable ( Grabbable  grab)
virtual

◆ ReleaseAll()

virtual void BNG.SnapZone.ReleaseAll ( )
virtual

Release everything snapped to us.

Member Data Documentation

◆ CanDropItem

bool BNG.SnapZone.CanDropItem = true

If false, Item will Move back to inventory space if player drops it.

◆ CanRemoveItem

bool BNG.SnapZone.CanRemoveItem = true

If false the item inside the snap zone may not be removed.

◆ CanSwapItem

bool BNG.SnapZone.CanSwapItem = true

If false the snap zone cannot have it's content replaced.

◆ ClosestGrabbable

Grabbable BNG.SnapZone.ClosestGrabbable

◆ DisableColliders

bool BNG.SnapZone.DisableColliders = true

◆ DuplicateItemOnGrab

bool BNG.SnapZone.DuplicateItemOnGrab = false

◆ ExcludeTransformNames

List<string> BNG.SnapZone.ExcludeTransformNames

Do not allow snapping if transform contains one of these names.

◆ HeldItem

Grabbable BNG.SnapZone.HeldItem

◆ LastSnapTime

float BNG.SnapZone.LastSnapTime

Last Time.time this item was snapped into.

◆ MaxDropTime

float BNG.SnapZone.MaxDropTime = 0.1f

Only snap if Grabbable was dropped maximum of X seconds ago.

◆ OnDetachEvent

GrabbableEvent BNG.SnapZone.OnDetachEvent

Optional Unity Event to be called when something has been detached from this SnapZone. Passes in the Grabbable is being detattached.

◆ OnlyAllowNames

List<string> BNG.SnapZone.OnlyAllowNames

If not empty, can only snap objects if transform name contains one of these strings.

◆ OnSnapEvent

GrabbableEvent BNG.SnapZone.OnSnapEvent

Optional Unity Event to be called when something is snapped to this SnapZone. Passes in the Grabbable that was attached.

◆ ScaleItem

float BNG.SnapZone.ScaleItem = 1f

Multiply Item Scale times this when in snap zone.

◆ SoundOnSnap

AudioClip BNG.SnapZone.SoundOnSnap

◆ SoundOnUnsnap

AudioClip BNG.SnapZone.SoundOnUnsnap

◆ StartingItem

Grabbable BNG.SnapZone.StartingItem

The documentation for this class was generated from the following file: