VisualizePlayers
Jump To Parameters
Jump To Function Definitions
Parameter Definitions
Select the parameter name from below to jump directly to it on this page.
allocateViewIds
autoSetTeamIfNotSet
debugging
joinedSound
leftSound
otherPlayer
ownerPlayer
parentObj
soundSource
teamName
allocateViewIds
If the child objects have a PhotonView component that you would like to allocate “
a unique view id to that belongs to the owning player, only the master client does the “
allocation. EX: Each child has a chat icon that only displays when the owner is speaking. “
This would require a PhotonView id to be allocated.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | bool | false |
autoSetTeamIfNotSet
By default a player enters a game without having his team set. This will automatically “
try to evenly choose a team for the entering player.\n\n”
IMPORTANT NOTE: You should only ever have this boolean enabled on one of these components at a time. “
Otherwise the enabled components will fight with each other.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | bool | false |
debugging
Enable this if you want to have verbose logging into the console to help you debug things.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | bool | false |
joinedSound
(Optional) Random sound to play when a player joins.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | AudioClip[] | new AudioClip[] { } |
leftSound
(Optional) Random sound to play when a player leaves.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | AudioClip[] | new AudioClip[] { } |
otherPlayer
Spawn this object when the found player is NOT the owner of the room.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | GameObject | null |
ownerPlayer
Spawn this object when the found player is the owner of the room.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | GameObject | null |
parentObj
The parent object of these newly spawned UI elements
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | Transform | null |
soundSource
(Optional) What AudioSource to play the leave/join sounds.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | AudioSource | null |
teamName
If you want to only see the players that are on a certain team. “
If blank this will just display everyone.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | string | ”” |
Function Definitions
Select the function name from below to jump directly to it on this page.
AutoSelectTeam
DestroyChildObjects
OnDisable
OnEnable
PlayJoinedSound
PlayLeftSound
SetOtherPlayerGO
SetOwnerPlayerGO
SpawnChild
SpawnChildObjects
Update
WaitRefresh
WaitToRefresh
protected virtual void AutoSelectTeam()
Will automatically try to evenly add playersto a select team. Loops over all players, skipping ones that already have a team set and captures all the players that don’t. Then it will set each captured player into a team one by one, evenly distributing them.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
protected virtual void DestroyChildObjects()
Destroys all child gameobjects of this gameobject that this component is attached to.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
protected virtual void OnDisable()
Will remove the
WaitRefreshfrom being called with theteamsUpdatedandvoiceViewUpdateddelegates.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
protected virtual void OnEnable()
Will add the
WaitRefreshto be called with theteamsUpdatedandvoiceViewUpdateddelegates.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
protected virtual void PlayJoinedSound()
Plays a random
joinedSoundat thesoundSource.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
protected virtual void PlayLeftSound()
Plays a random
leftSoundat thesoundSource.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
public virtual void SetOtherPlayerGO(GameObject newOtherPlayer)
Can be used by other classes to set the
otherPlayergameobject to be spawned.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| newOtherPlayer | GameObject type, the gameobject to spawn when the player connecting is not the master client |
public virtual void SetOwnerPlayerGO(GameObject newOwnerPlayer)
Can be used by other classes to set the
newOwnerPlayergameobject to be spawned.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| newOtherPlayer | GameObject type, the gameobject to spawn when the player connecting is the master client |
protected virtual void SpawnChild(KeyValuePair<int, Photon.Realtime.Player> target_player)
Spawns a new child gameobject for the passed in player.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| target_player | KeyValuePair<int, Photon.Realtime.Player> type, the connected player dictionary |
protected virtual void SpawnChildObjects()
Loops over all the players in the current room and calls
SpawnChildon each one.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
protected virtual void Update()
Will dynamically instantiate the
ownerPlayerif you or theotherPlayergameobjects when a player joins the photon room, based on if they’re the master client or not. Also plays a sound (if one is set) when a player joins and leave the room. If theautoSetTeamIfNotSetis true and the player joining doesn’t already have a team set (from joining previously) then this will be called to automatically select a team for them.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
public virtual void WaitRefresh()
Calls the
WaitToRefreshIEnumerator
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
No parameters
protected virtual System.Collections.IEnumerator WaitToRefresh()
Calls
DestroyChildObjectsandSpawnChildObjectsfunctions.
| Expose Value | Overrideable | Returns |
|---|---|---|
| private | False |
No parameters