|
Serious Game - Electrónica VR 1.0.0
|
LED con simulación educativa: muestra verde (correcto), rojo (sobrecarga), negro (sin corriente / polaridad invertida). Usa MaterialPropertyBlock para evitar crear materiales duplicados en cada frame. More...


Public Member Functions | |
| override float | GetResistance () |
| override void | Calculate () |
| void | SetPolarityInverted (bool inverted) |
| Invierte la polaridad del LED (útil para GameManager en Reto 3). | |
| Public Member Functions inherited from ElectricalComponent | |
| float | GetResistance () |
| void | Calculate () |
Public Attributes | |
| float | resistance = 50f |
| bool | polarityInverted = false |
| float | minOperatingCurrent = 0.005f |
| float | maxSafeCurrent = 0.02f |
| float | overloadCurrent = 0.1f |
| Color | colorOff = Color.black |
| Color | colorCorrect = Color.green |
| Color | colorOverload = Color.red |
| bool | isOn = false |
| LEDState | state = LEDState.Off |
| Public Attributes inherited from ElectricalComponent | |
| ElectricalNode | nodeA |
| ElectricalNode | nodeB |
| float | current |
| float | voltageDrop |
Private Member Functions | |
| void | Awake () |
| void | SetState (LEDState newState) |
| void | ApplyColor (Color color) |
| Aplica color con MaterialPropertyBlock — NO crea materiales nuevos. | |
Private Attributes | |
| Renderer | _renderer |
| MaterialPropertyBlock | _mpb |
Static Private Attributes | |
| static readonly int | _colorID = Shader.PropertyToID("_Color") |
| static readonly int | _emissionID = Shader.PropertyToID("_EmissionColor") |
LED con simulación educativa: muestra verde (correcto), rojo (sobrecarga), negro (sin corriente / polaridad invertida). Usa MaterialPropertyBlock para evitar crear materiales duplicados en cada frame.
|
private |
Aplica color con MaterialPropertyBlock — NO crea materiales nuevos.
|
private |
| override void LED.Calculate | ( | ) |
| override float LED.GetResistance | ( | ) |
| void LED.SetPolarityInverted | ( | bool | inverted | ) |
Invierte la polaridad del LED (útil para GameManager en Reto 3).
|
private |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
| Color LED.colorCorrect = Color.green |
| Color LED.colorOff = Color.black |
| Color LED.colorOverload = Color.red |
| bool LED.isOn = false |
| float LED.maxSafeCurrent = 0.02f |
| float LED.minOperatingCurrent = 0.005f |
| float LED.overloadCurrent = 0.1f |
| bool LED.polarityInverted = false |
| float LED.resistance = 50f |
| LEDState LED.state = LEDState.Off |