/// <summary> /// Acquires the team directly after <paramref name="team"/>. If <paramref name="team"/> is the last team, the team returned is the first team. /// </summary> /// <param name="team"> The team previous to the one we are retrieving. /// </param> /// <returns> The team directly after <paramref name="team"/>. /// </returns> protected MinigameTeamContainer GetTeamContainerAfter(MinigameTeamContainer teamContainer) { int index = this.TeamContainers.IndexOf(teamContainer); int nextIndex = (index + 1) % this.TeamContainers.Count; return this.TeamContainers[nextIndex]; }
/// <summary> /// Adds <paramref name="team"/> to this minigame. /// </summary> /// <param name="team"> The team to add to this minigame. /// </param> protected void AddTeamContainer(MinigameTeamContainer teamContainer) { this.TeamContainers.Add(teamContainer); }
/// <summary> /// Requests this client's player to be added to <paramref name="team"/>. /// </summary> /// <param name="team"> The team to add this player to. /// </param> public void AddPlayerToTeam(MinigameTeamContainer teamContainer) { // this.photonView.RpcAsMaster("AddPlayerToTeam", PhotonTargets.AllBufferedViaServer, PhotonNetwork.player, team); this.photonView.RPC("AddPlayerToTeam", PhotonTargets.AllBufferedViaServer, PhotonNetwork.player, teamContainer.Team); }