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

Objeto de red compartido entre Técnico y Explorador. More...

Inheritance diagram for GameSession:
Inheritance graph
Collaboration diagram for GameSession:
Collaboration graph

Public Member Functions

override void Spawned ()
void EnviarComponente (ComponentType tipo, float valor)
 Solo el Técnico (Host/StateAuthority) puede enviar componentes.
void ReportarInstalacion (bool exito)
 El Explorador llama esto al instalar un componente.
void AvanzarReto (int nuevoReto)

Properties

static GameSession Instance [get, private set]
int RetoActual [get, set]
NetworkBool HayComponentePendiente [get, set]
int TipoComponentePendiente [get, set]
float ValorComponentePendiente [get, set]

Events

static System.Action< ComponentType, float > OnComponenteRecibido
 Explorador: se dispara cuando el Técnico envía un componente.
static System.Action< bool > OnComponenteInstalado
 Técnico: se dispara cuando el Explorador instala (o falla).
static System.Action< int > OnRetoChanged
 Ambos: el reto cambió.

Private Member Functions

void RPC_EnviarComponente (int tipo, float valor)
void RPC_ComponenteInstalado (NetworkBool exito)
void RPC_CambiarReto (int reto)

Detailed Description

Objeto de red compartido entre Técnico y Explorador.

SETUP EN UNITY:

  1. Crear un GameObject vacío llamado "GameSession" en AMBAS escenas (Tecnico.unity y Explorador.unity).
  2. Añadirle este script + NetworkObject (Fusion).
  3. Guardarlo como prefab en Resources/GameSession.prefab (Fusion lo usa para sincronizarlo automáticamente).

FLUJO: Técnico llama RPC_EnviarComponente → Explorador recibe OnComponenteRecibido Explorador instala → llama RPC_ComponenteInstalado → Técnico recibe OnComponenteInstalado Técnico avanza reto → llama RPC_CambiarReto → ambos reciben OnRetoChanged

Member Function Documentation

◆ AvanzarReto()

void GameSession.AvanzarReto ( int nuevoReto)

◆ EnviarComponente()

void GameSession.EnviarComponente ( ComponentType tipo,
float valor )

Solo el Técnico (Host/StateAuthority) puede enviar componentes.

◆ ReportarInstalacion()

void GameSession.ReportarInstalacion ( bool exito)

El Explorador llama esto al instalar un componente.

◆ RPC_CambiarReto()

void GameSession.RPC_CambiarReto ( int reto)
private

◆ RPC_ComponenteInstalado()

void GameSession.RPC_ComponenteInstalado ( NetworkBool exito)
private

◆ RPC_EnviarComponente()

void GameSession.RPC_EnviarComponente ( int tipo,
float valor )
private

◆ Spawned()

override void GameSession.Spawned ( )

Property Documentation

◆ HayComponentePendiente

NetworkBool GameSession.HayComponentePendiente
getset

◆ Instance

GameSession GameSession.Instance
staticgetprivate set

◆ RetoActual

int GameSession.RetoActual
getset

◆ TipoComponentePendiente

int GameSession.TipoComponentePendiente
getset

◆ ValorComponentePendiente

float GameSession.ValorComponentePendiente
getset

Event Documentation

◆ OnComponenteInstalado

System.Action<bool> GameSession.OnComponenteInstalado
static

Técnico: se dispara cuando el Explorador instala (o falla).

◆ OnComponenteRecibido

System.Action<ComponentType, float> GameSession.OnComponenteRecibido
static

Explorador: se dispara cuando el Técnico envía un componente.

◆ OnRetoChanged

System.Action<int> GameSession.OnRetoChanged
static

Ambos: el reto cambió.


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