|
Serious Game - Electrónica VR 1.0.0
|
Dibuja cables visuales entre componentes del circuito usando LineRenderer. Se actualiza automáticamente cuando el circuito cambia (OnCircuitChanged). More...


Public Member Functions | |
| void | Rebuild () |
| Reconstruye todos los cables (útil al mover componentes en runtime). | |
Public Attributes | |
| List< Transform > | circuitPoints = new List<Transform>() |
| Material | wireMaterial |
| Color | colorNormal = new Color(0.2f, 0.8f, 0.3f) |
| Color | colorFaulty = new Color(0.8f, 0.2f, 0.2f) |
| Color | colorFlow = new Color(0.4f, 1.0f, 0.6f) |
| float | wireWidth = 0.015f |
| bool | animateFlow = true |
| float | flowSpeed = 1.5f |
| CircuitManager | circuitManager |
Private Member Functions | |
| void | Awake () |
| void | OnEnable () |
| void | OnDisable () |
| void | Update () |
| void | BuildWires () |
| void | OnCircuitChanged () |
| void | UpdateWirePositions () |
| void | UpdateWireColors () |
| void | SetWireColor (LineRenderer lr, Color c) |
| void | OnDrawGizmos () |
Private Attributes | |
| List< LineRenderer > | _wires = new List<LineRenderer>() |
| bool | _hasCurrent = false |
| float | _flowOffset = 0f |
Dibuja cables visuales entre componentes del circuito usando LineRenderer. Se actualiza automáticamente cuando el circuito cambia (OnCircuitChanged).
SETUP en Unity:
JERARQUÍA RESULTANTE: Circuit ├─ VoltageSource ├─ Resistor ├─ LED ├─ Node Positive ← esferas de nodo ├─ Node Ground └─ WireRenderer ← este script ├─ Wire_0 ← generado automáticamente ├─ Wire_1 └─ Wire_2
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| void CircuitWireRenderer.Rebuild | ( | ) |
Reconstruye todos los cables (útil al mover componentes en runtime).
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| bool CircuitWireRenderer.animateFlow = true |
| CircuitManager CircuitWireRenderer.circuitManager |
| List<Transform> CircuitWireRenderer.circuitPoints = new List<Transform>() |
| Color CircuitWireRenderer.colorFaulty = new Color(0.8f, 0.2f, 0.2f) |
| Color CircuitWireRenderer.colorFlow = new Color(0.4f, 1.0f, 0.6f) |
| Color CircuitWireRenderer.colorNormal = new Color(0.2f, 0.8f, 0.3f) |
| float CircuitWireRenderer.flowSpeed = 1.5f |
| Material CircuitWireRenderer.wireMaterial |
| float CircuitWireRenderer.wireWidth = 0.015f |