Photon Unity Networking 2
2.52
Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension. More...
Inherits MonoBehaviour, IMatchmakingCallbacks, and IInRoomCallbacks.
Public Member Functions | |
| bool | TryGetTeamByCode (byte code, out PhotonTeam team) |
| Find a PhotonTeam using a team code. More... | |
| bool | TryGetTeamByName (string teamName, out PhotonTeam team) |
| Find a PhotonTeam using a team name. More... | |
| PhotonTeam[] | GetAvailableTeams () |
| Gets all teams available. More... | |
| bool | TryGetTeamMembers (byte code, out Player[] members) |
| Gets all players joined to a team using a team code. More... | |
| bool | TryGetTeamMembers (string teamName, out Player[] members) |
| Gets all players joined to a team using a team name. More... | |
| bool | TryGetTeamMembers (PhotonTeam team, out Player[] members) |
| Gets all players joined to a team. More... | |
| bool | TryGetTeamMatesOfPlayer (Player player, out Player[] teamMates) |
| Gets all team mates of a player. More... | |
| int | GetTeamMembersCount (byte code) |
| Gets the number of players in a team by team code. More... | |
| int | GetTeamMembersCount (string name) |
| Gets the number of players in a team by team name. More... | |
| int | GetTeamMembersCount (PhotonTeam team) |
| Gets the number of players in a team. More... | |
Static Public Attributes | |
| const string | TeamPlayerProp = "_pt" |
| Defines the player custom property name to use for team affinity of "this" player. More... | |
Properties | |
| static PhotonTeamsManager | Instance [get] |
Events | |
| static Action< Player, PhotonTeam > | PlayerJoinedTeam |
| static Action< Player, PhotonTeam > | PlayerLeftTeam |
Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension.
Teams are defined by enum Team. Change this to get more / different teams. There are no rules when / if you can join a team. You could add this in JoinTeam or something.
| PhotonTeam [] GetAvailableTeams | ( | ) |
Gets all teams available.
| int GetTeamMembersCount | ( | byte | code | ) |
Gets the number of players in a team by team code.
| code | Unique code of the team |
| int GetTeamMembersCount | ( | PhotonTeam | team | ) |
Gets the number of players in a team.
| team | The team you want to know the size of |
| int GetTeamMembersCount | ( | string | name | ) |
Gets the number of players in a team by team name.
| name | Unique name of the team |
| bool TryGetTeamByCode | ( | byte | code, |
| out PhotonTeam | team | ||
| ) |
Find a PhotonTeam using a team code.
| code | The team code. |
| team | The team to be assigned if found. |
| bool TryGetTeamByName | ( | string | teamName, |
| out PhotonTeam | team | ||
| ) |
Find a PhotonTeam using a team name.
| teamName | The team name. |
| team | The team to be assigned if found. |
Gets all team mates of a player.
| player | The player whose team mates will be searched. |
| teamMates | The array of players to be filled. |
| bool TryGetTeamMembers | ( | byte | code, |
| out Player[] | members | ||
| ) |
Gets all players joined to a team using a team code.
| code | The code of the team. |
| members | The array of players to be filled. |
| bool TryGetTeamMembers | ( | PhotonTeam | team, |
| out Player[] | members | ||
| ) |
Gets all players joined to a team.
| team | The team which will be used to find players. |
| members | The array of players to be filled. |
| bool TryGetTeamMembers | ( | string | teamName, |
| out Player[] | members | ||
| ) |
Gets all players joined to a team using a team name.
| teamName | The name of the team. |
| members | The array of players to be filled. |
|
static |
Defines the player custom property name to use for team affinity of "this" player.