Serious Game - Electrónica VR 1.0.0
Loading...
Searching...
No Matches
GrabbableComponent Class Reference

Va en cada prefab de componente entregable (Comp_Resistor, Comp_LED, Comp_Capacitor, ArduinoPin). Gestiona el ciclo grab→soltar con física y feedback háptico. More...

Inheritance diagram for GrabbableComponent:
Inheritance graph
Collaboration diagram for GrabbableComponent:
Collaboration graph

Public Member Functions

void DisableGrab ()
 Llamado por ComponentSlot tras una instalación exitosa. Deshabilita el grab para que no se pueda volver a coger del slot.

Public Attributes

HapticFeedback haptics
SelectableComponent selectable
PlayerInteraction playerInteraction

Private Member Functions

void Awake ()
void OnEnable ()
void OnDisable ()
void OnGrabbed (SelectEnterEventArgs args)
void OnReleased (SelectExitEventArgs args)

Private Attributes

XRGrabInteractable _grab
Rigidbody _rb

Detailed Description

Va en cada prefab de componente entregable (Comp_Resistor, Comp_LED, Comp_Capacitor, ArduinoPin). Gestiona el ciclo grab→soltar con física y feedback háptico.

SETUP EN CADA PREFAB (hacerlo una vez, se aplica a todas las instancias):

  1. XRGrabInteractable — Movement Type: Kinematic — Track Position: ON — Track Rotation: ON
  2. Rigidbody — Is Kinematic: TRUE (empieza quieto en la bandeja)
  3. Collider — Is Trigger: FALSE (para detección física y slots)
  4. Este script

FLUJO: Componente spawneado en toolbox (kinematic, quieto) → Explorador aprieta gatillo cerca del componente → OnGrabbed: se desparentea de la caja, kinematic OFF, sigue la mano → Explorador lo mete en el ComponentSlot del circuito → ComponentSlot.OnTriggerEnter: instala, kinematic ON otra vez

Member Function Documentation

◆ Awake()

void GrabbableComponent.Awake ( )
private

◆ DisableGrab()

void GrabbableComponent.DisableGrab ( )

Llamado por ComponentSlot tras una instalación exitosa. Deshabilita el grab para que no se pueda volver a coger del slot.

◆ OnDisable()

void GrabbableComponent.OnDisable ( )
private

◆ OnEnable()

void GrabbableComponent.OnEnable ( )
private

◆ OnGrabbed()

void GrabbableComponent.OnGrabbed ( SelectEnterEventArgs args)
private

◆ OnReleased()

void GrabbableComponent.OnReleased ( SelectExitEventArgs args)
private

Member Data Documentation

◆ _grab

XRGrabInteractable GrabbableComponent._grab
private

◆ _rb

Rigidbody GrabbableComponent._rb
private

◆ haptics

HapticFeedback GrabbableComponent.haptics

◆ playerInteraction

PlayerInteraction GrabbableComponent.playerInteraction

◆ selectable

SelectableComponent GrabbableComponent.selectable

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