/// <summary> /// Fired after the simulation instance has been created, allowing us to call it using the instance of the simulation /// from static method. /// </summary> private void OnPostCreate() { Scoring = new ScoringModule(); // Allows for other players to see deaths of previous players on the trail. Tombstone = new TombstoneModule(); }
private void OnScoresUpdated(ScoringModule sender, ScoresUpdatedEventArgs e) { PipesGame pipes = Ets.Room.GetGame <PipesGame>(); lblScorePipes.text = e.Scores.ContainsScore(pipes) ? e.Scores.GetScore(pipes).ToString() : "-"; CratesGame crates = Ets.Room.GetGame <CratesGame>(); lblScoreCrane.text = e.Scores.ContainsScore(crates) ? e.Scores.GetScore(crates).ToString() : "-"; DynamiteGame dynamite = Ets.Room.GetGame <DynamiteGame>(); lblScoreDynamite.text = e.Scores.ContainsScore(dynamite) ? e.Scores.GetScore(dynamite).ToString() : "-"; TriggersGame trigger = Ets.Room.GetGame <TriggersGame>(); lblScoreTrigger.text = e.Scores.ContainsScore(trigger) ? e.Scores.GetScore(trigger).ToString() : "-"; }
// Use this for initialization protected virtual void Awake() { btnDifficulty[0] = transform.Find("pnlDifficulties").Find("btnEasy").GetComponent <Button>(); btnDifficulty[1] = transform.Find("pnlDifficulties").Find("btnDefault").GetComponent <Button>(); btnDifficulty[2] = transform.Find("pnlDifficulties").Find("btnHard").GetComponent <Button>(); btnInitialize = transform.Find("btnInitialize").GetComponent <Button>(); btnStart = transform.Find("btnStart").GetComponent <Button>(); btnAbort = transform.Find("btnAbort").GetComponent <Button>(); btnComplete = transform.Find("btnComplete").GetComponent <Button>(); transform.Find("pnlGameMonitor").Find("lblStatsCaptions").GetComponent <Text>().text = statsCaptionStr; lblState = transform.Find("lblState").GetComponent <Text>(); lblStats = transform.Find("pnlGameMonitor").Find("lblStats").GetComponent <Text>(); timeToUpdate = statsUpdateInterval; EscapeRoom <IEtsInterface> room = Ets.Room; scoring = room.GetModule <ScoringModule>(); if (room == null || room.GetGame(gameId) == null) { DisableButtons(); } else { game = room.GetGame(gameId); //print("Game found: " + game); Text lblTitle = transform.Find("lblTitle").GetComponent <Text>(); lblTitle.text = game.Id.ToUpper(); room.OnRoomStateChanged += OnRoomStateChanged; game.OnGameStateChanged += OnGameStateChanged; //OnRoomStateChanged(Room, Room.State, Room.State); //OnGameStateChanged(Game, Game.State, Game.State); } }