public void SendTeamSetupUpdate(TeamList redTeam, TeamList blueTeam) { string redTeamString = JsonUtility.SerializeToJson <TeamList>(redTeam); string blueTeamString = JsonUtility.SerializeToJson <TeamList>(blueTeam); RedTeam = redTeam; BlueTeam = blueTeam; networkView.RPC("RPCSendTeamData", RPCMode.Others, redTeamString, blueTeamString); }
private void RPCSendTeamData(string redTeamData, string blueTeamData) { TeamList redTeam = JsonUtility.ValidateJsonData <TeamList>(redTeamData); TeamList blueTeam = JsonUtility.ValidateJsonData <TeamList>(blueTeamData); clientManager.SendGameMessage(new UpdateTeamRoster() { RedTeam = redTeam, BlueTeam = blueTeam }); }
public override void Init(NetworkManager networkManager) { NetworkManager = networkManager as ClientNetworkManager; TeamRoster = new TeamList[2]; OnUpdateTeamRoster += (red, blue) => { TeamRoster[0] = red; TeamRoster[1] = blue; }; //Init all states ClientLobbyState = new ClientLobbyState(this); ClientGameSetupState = new ClientGameSetupState(this); ClientGamePlayState = new ClientGamePlayState(this); ClientGameEndState = new ClientGameEndState(this); ChangeState(ClientLobbyState); }