public void Init(MatchSettings settings, MatchManager matchManager, MatchMessenger messenger, bool raceIsInProgress) { this.settings = settings; this.matchManager = matchManager; this.messenger = messenger; messenger.CreateListener <StartRaceMessage>(StartRaceCallback); messenger.CreateListener <ClientLeftMessage>(ClientLeftCallback); messenger.CreateListener <DoneRacingMessage>(DoneRacingCallback); if (raceIsInProgress) { Debug.Log("Starting race in progress"); joinedWhileRaceInProgress = true; CreateBallObjects(); } }
//Called when succesfully connected to a server private void BeginOnlineGame(MatchState matchState) { MatchManager manager = Instantiate(matchManagerPrefab); manager.InitOnlineMatch(joiningClient, matchState); }
public void BeginLocalGame() { MatchManager manager = Instantiate(matchManagerPrefab); manager.InitLocalMatch(); }