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

Componente físico sobre la mesa del Técnico. PC: hover (mouse) + click → selecciona y coloca en la bandeja. VR: rayo del controlador → hover + gatillo → mismo resultado. More...

Inheritance diagram for DeskComponent:
Inheritance graph
Collaboration diagram for DeskComponent:
Collaboration graph

Public Member Functions

void SelectThisComponent ()
void Deselect ()

Public Attributes

ComponentType componentType = ComponentType.Resistor
float componentValue = 100f
string componentDescription = "100 Ω"
ComponentSendingTray tray
Color colorNormal = new Color(0.3f, 0.3f, 0.4f)
Color colorHover = new Color(0.9f, 0.8f, 0.2f)
Color colorSelected = new Color(0.2f, 0.8f, 0.4f)
float emissionIntensity = 1.8f
float selectedScaleMultiplier = 1.08f

Private Member Functions

void Awake ()
void OnEnable ()
void OnDisable ()
void OnMouseEnter ()
void OnMouseExit ()
void OnMouseDown ()
void IPointerClickHandler. OnPointerClick (PointerEventData e)
void IPointerEnterHandler. OnPointerEnter (PointerEventData e)
void IPointerExitHandler. OnPointerExit (PointerEventData e)
void OnXRHoverEnter (HoverEnterEventArgs args)
void OnXRHoverExit (HoverExitEventArgs args)
void OnXRSelect (SelectEnterEventArgs args)
void SetColor (Color c)

Private Attributes

Renderer _renderer
MaterialPropertyBlock _mpb
bool _isSelected
Vector3 _originalScale
XRBaseInteractable _xrInteractable

Static Private Attributes

static readonly int _colorID = Shader.PropertyToID("_Color")
static readonly int _baseColorID = Shader.PropertyToID("_BaseColor")
static readonly int _emissionColorID = Shader.PropertyToID("_EmissionColor")

Detailed Description

Componente físico sobre la mesa del Técnico. PC: hover (mouse) + click → selecciona y coloca en la bandeja. VR: rayo del controlador → hover + gatillo → mismo resultado.

SETUP VR (opcional — sin esto funciona solo en PC): Añadir XRSimpleInteractable al GameObject. No hace falta Rigidbody ni cambiar nada más; este script detecta el interactable automáticamente en Awake y conecta los eventos.

Member Function Documentation

◆ Awake()

void DeskComponent.Awake ( )
private

◆ Deselect()

void DeskComponent.Deselect ( )

◆ OnDisable()

void DeskComponent.OnDisable ( )
private

◆ OnEnable()

void DeskComponent.OnEnable ( )
private

◆ OnMouseDown()

void DeskComponent.OnMouseDown ( )
private

◆ OnMouseEnter()

void DeskComponent.OnMouseEnter ( )
private

◆ OnMouseExit()

void DeskComponent.OnMouseExit ( )
private

◆ OnPointerClick()

void IPointerClickHandler. DeskComponent.OnPointerClick ( PointerEventData e)
private

◆ OnPointerEnter()

void IPointerEnterHandler. DeskComponent.OnPointerEnter ( PointerEventData e)
private

◆ OnPointerExit()

void IPointerExitHandler. DeskComponent.OnPointerExit ( PointerEventData e)
private

◆ OnXRHoverEnter()

void DeskComponent.OnXRHoverEnter ( HoverEnterEventArgs args)
private

◆ OnXRHoverExit()

void DeskComponent.OnXRHoverExit ( HoverExitEventArgs args)
private

◆ OnXRSelect()

void DeskComponent.OnXRSelect ( SelectEnterEventArgs args)
private

◆ SelectThisComponent()

void DeskComponent.SelectThisComponent ( )

◆ SetColor()

void DeskComponent.SetColor ( Color c)
private

Member Data Documentation

◆ _baseColorID

readonly int DeskComponent._baseColorID = Shader.PropertyToID("_BaseColor")
staticprivate

◆ _colorID

readonly int DeskComponent._colorID = Shader.PropertyToID("_Color")
staticprivate

◆ _emissionColorID

readonly int DeskComponent._emissionColorID = Shader.PropertyToID("_EmissionColor")
staticprivate

◆ _isSelected

bool DeskComponent._isSelected
private

◆ _mpb

MaterialPropertyBlock DeskComponent._mpb
private

◆ _originalScale

Vector3 DeskComponent._originalScale
private

◆ _renderer

Renderer DeskComponent._renderer
private

◆ _xrInteractable

XRBaseInteractable DeskComponent._xrInteractable
private

◆ colorHover

Color DeskComponent.colorHover = new Color(0.9f, 0.8f, 0.2f)

◆ colorNormal

Color DeskComponent.colorNormal = new Color(0.3f, 0.3f, 0.4f)

◆ colorSelected

Color DeskComponent.colorSelected = new Color(0.2f, 0.8f, 0.4f)

◆ componentDescription

string DeskComponent.componentDescription = "100 Ω"

◆ componentType

ComponentType DeskComponent.componentType = ComponentType.Resistor

◆ componentValue

float DeskComponent.componentValue = 100f

◆ emissionIntensity

float DeskComponent.emissionIntensity = 1.8f

◆ selectedScaleMultiplier

float DeskComponent.selectedScaleMultiplier = 1.08f

◆ tray

ComponentSendingTray DeskComponent.tray

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