C# Класс PhotonPlayer, PaperCowboys

Summarizes a "player" within a room, identified (in that room) by actorID.
Each player has a actorID, valid for that room. It's -1 until it's assigned by server.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
isLocal bool

Открытые методы

Метод Описание
Equals ( object p ) : bool

Makes PhotonPlayer comparable

Find ( int ID ) : PhotonPlayer,

Try to get a specific player by id.

GetHashCode ( ) : int
PhotonPlayer ( bool isLocal, int actorID, string name ) : System.Collections

Creates a PhotonPlayer instance.

SetCustomProperties ( Hashtable propertiesToSet ) : void

Updates and synchronizes the named properties of this Player with the values of propertiesToSet.

Any player's properties are available in a Room only and only until the player disconnect or leaves. Access any player's properties by: Player.CustomProperties (read-only!) but don't modify that hashtable. New properties are added, existing values are updated. Other values will not be changed, so only provide values that changed or are new. To delete a named (custom) property of this player, use null as value. Only string-typed keys are applied (everything else is ignored). Local cache is updated immediately, other players are updated through Photon with a fitting operation. To reduce network traffic, set only values that actually changed.

ToString ( ) : string

Gives the name.

Защищенные методы

Метод Описание
PhotonPlayer ( bool isLocal, int actorID, Hashtable properties ) : System.Collections

Internally used to create players from event Join

Приватные методы

Метод Описание
InternalCacheProperties ( Hashtable properties ) : void

Caches custom properties for this player.

InternalChangeLocalID ( int newID ) : void

Used internally, to update this client's playerID when assigned.

Описание методов

Equals() публичный Метод

Makes PhotonPlayer comparable
public Equals ( object p ) : bool
p object
Результат bool

Find() публичный статический Метод

Try to get a specific player by id.
public static Find ( int ID ) : PhotonPlayer,
ID int ActorID
Результат PhotonPlayer,

GetHashCode() публичный Метод

public GetHashCode ( ) : int
Результат int

PhotonPlayer() защищенный Метод

Internally used to create players from event Join
protected PhotonPlayer ( bool isLocal, int actorID, Hashtable properties ) : System.Collections
isLocal bool
actorID int
properties Hashtable
Результат System.Collections

PhotonPlayer() публичный Метод

Creates a PhotonPlayer instance.
public PhotonPlayer ( bool isLocal, int actorID, string name ) : System.Collections
isLocal bool If this is the local peer's player (or a remote one).
actorID int ID or ActorNumber of this player in the current room (a shortcut to identify each player in room)
name string Name of the player (a "well known property").
Результат System.Collections

SetCustomProperties() публичный Метод

Updates and synchronizes the named properties of this Player with the values of propertiesToSet.
Any player's properties are available in a Room only and only until the player disconnect or leaves. Access any player's properties by: Player.CustomProperties (read-only!) but don't modify that hashtable. New properties are added, existing values are updated. Other values will not be changed, so only provide values that changed or are new. To delete a named (custom) property of this player, use null as value. Only string-typed keys are applied (everything else is ignored). Local cache is updated immediately, other players are updated through Photon with a fitting operation. To reduce network traffic, set only values that actually changed.
public SetCustomProperties ( Hashtable propertiesToSet ) : void
propertiesToSet Hashtable Hashtable of props to udpate, set and sync. See description.
Результат void

ToString() публичный Метод

Gives the name.
public ToString ( ) : string
Результат string

Описание свойств

isLocal публичное свойство

Only one player is controlled by each client. Others are not local.
public bool isLocal
Результат bool