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

Permite al Explorador corregir la polaridad de un LED o Capacitor en el Reto 3. More...

Inheritance diagram for FlippableComponent:
Inheritance graph
Collaboration diagram for FlippableComponent:
Collaboration graph

Public Types

enum  FlipType { LED , Capacitor }

Public Attributes

FlipType flipType = FlipType.LED
LED ledComponent
Capacitor capacitorComponent
PlayerInteraction playerInteraction
GameObject fixedIndicator
Color colorPendiente = new Color(1f, 0.3f, 0.1f)
Color colorCorregido = new Color(0.2f, 0.9f, 0.3f)

Private Member Functions

void Awake ()
void OnEnable ()
void OnDisable ()
void Update ()
void OnFlip (SelectEnterEventArgs args)
bool IsCurrentlyInverted ()
void SetRendererColor (Color c)

Private Attributes

XRSimpleInteractable _interactable
Renderer _renderer
MaterialPropertyBlock _mpb

Static Private Attributes

static readonly int _colorID = Shader.PropertyToID("_BaseColor")

Detailed Description

Permite al Explorador corregir la polaridad de un LED o Capacitor en el Reto 3.

SETUP EN UNITY (en el GameObject del LED o Capacitor en reto3Zone):

  1. Añadir este script.
  2. Añadir XRSimpleInteractable + Collider al mismo GameObject.
  3. Asignar flipType (LED o Capacitor).
  4. Asignar el componente eléctrico (ledComponent o capacitorComponent).
  5. Asignar playerInteraction desde la escena.

FLUJO: Explorador apunta con el controlador y pulsa gatillo → OnFlip() detecta el tipo → llama PlayerInteraction.CorrectPolarity() → polarityInverted = false → circuit.MarkDirty() → circuito resimula → InstructionSystem avanza al siguiente paso

Member Enumeration Documentation

◆ FlipType

Enumerator
LED 
Capacitor 

Member Function Documentation

◆ Awake()

void FlippableComponent.Awake ( )
private

◆ IsCurrentlyInverted()

bool FlippableComponent.IsCurrentlyInverted ( )
private

◆ OnDisable()

void FlippableComponent.OnDisable ( )
private

◆ OnEnable()

void FlippableComponent.OnEnable ( )
private

◆ OnFlip()

void FlippableComponent.OnFlip ( SelectEnterEventArgs args)
private

◆ SetRendererColor()

void FlippableComponent.SetRendererColor ( Color c)
private

◆ Update()

void FlippableComponent.Update ( )
private

Member Data Documentation

◆ _colorID

readonly int FlippableComponent._colorID = Shader.PropertyToID("_BaseColor")
staticprivate

◆ _interactable

XRSimpleInteractable FlippableComponent._interactable
private

◆ _mpb

MaterialPropertyBlock FlippableComponent._mpb
private

◆ _renderer

Renderer FlippableComponent._renderer
private

◆ capacitorComponent

Capacitor FlippableComponent.capacitorComponent

◆ colorCorregido

Color FlippableComponent.colorCorregido = new Color(0.2f, 0.9f, 0.3f)

◆ colorPendiente

Color FlippableComponent.colorPendiente = new Color(1f, 0.3f, 0.1f)

◆ fixedIndicator

GameObject FlippableComponent.fixedIndicator

◆ flipType

FlipType FlippableComponent.flipType = FlipType.LED

◆ ledComponent

LED FlippableComponent.ledComponent

◆ playerInteraction

PlayerInteraction FlippableComponent.playerInteraction

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