Photon Unity Networking 2 2.45

Static Public Member Functions | List of all members
TeamExtensions Class Reference

Extension used for PunTeams and Player class. Wraps access to the player's custom property. More...

Static Public Member Functions

static PunTeams.Team GetTeam (this Player player)
 Extension for Player class to wrap up access to the player's custom property. More...
 
static void SetTeam (this Player player, PunTeams.Team team)
 Switch that player's team to the one you assign. More...
 

Detailed Description

Extension used for PunTeams and Player class. Wraps access to the player's custom property.

Member Function Documentation

◆ GetTeam()

static PunTeams.Team GetTeam ( this Player  player)
static

Extension for Player class to wrap up access to the player's custom property.

Returns
PunTeam.Team.none if no team was found (yet).

◆ SetTeam()

static void SetTeam ( this Player  player,
PunTeams.Team  team 
)
static

Switch that player's team to the one you assign.

Internally checks if this player is in that team already or not. Only team switches are actually sent.

Parameters
player
team