C# Class PhotonStream, Droid-Soccer

This container is used in OnPhotonSerializeView() to either provide incoming data of a PhotonView or for you to provide it.
The isWriting property will be true if this client is the "owner" of the PhotonView (and thus the GameObject). Add data to the stream and it's sent via the server to the other players in a room. On the receiving side, isWriting is false and the data should be read. Send as few data as possible to keep connection quality up. An empty PhotonStream will not be sent. Use either Serialize() for reading and writing or SendNext() and ReceiveNext(). The latter two are just explicit read and write methods but do about the same work as Serialize(). It's a matter of preference which methods you use.
Afficher le fichier Open project: repelex/Droid-Soccer Class Usage Examples

Méthodes publiques

Méthode Description
PeekNext ( ) : object

Read next piece of data from the stream without advancing the "current" item.

PhotonStream ( bool write, object incomingData ) : System

Creates a stream and initializes it. Used by PUN internally.

ReceiveNext ( ) : object

Read next piece of data from the stream when isReading is true.

SendNext ( object obj ) : void

Add another piece of data to send it when isWriting is true.

Serialize ( PhotonPlayer, &obj ) : void

Will read or write the value, depending on the stream's isWriting value.

Serialize ( Quaternion &obj ) : void

Will read or write the value, depending on the stream's isWriting value.

Serialize ( Vector2 &obj ) : void

Will read or write the value, depending on the stream's isWriting value.

Serialize ( Vector3 &obj ) : void

Will read or write the value, depending on the stream's isWriting value.

Serialize ( bool &myBool ) : void

Will read or write the value, depending on the stream's isWriting value.

Serialize ( char &value ) : void

Will read or write the value, depending on the stream's isWriting value.

Serialize ( float &obj ) : void

Will read or write the value, depending on the stream's isWriting value.

Serialize ( int &myInt ) : void

Will read or write the value, depending on the stream's isWriting value.

Serialize ( short &value ) : void

Will read or write the value, depending on the stream's isWriting value.

Serialize ( string &value ) : void

Will read or write the value, depending on the stream's isWriting value.

ToArray ( ) : object[]

Turns the stream into a new object[].

Method Details

PeekNext() public méthode

Read next piece of data from the stream without advancing the "current" item.
public PeekNext ( ) : object
Résultat object

PhotonStream() public méthode

Creates a stream and initializes it. Used by PUN internally.
public PhotonStream ( bool write, object incomingData ) : System
write bool
incomingData object
Résultat System

ReceiveNext() public méthode

Read next piece of data from the stream when isReading is true.
public ReceiveNext ( ) : object
Résultat object

SendNext() public méthode

Add another piece of data to send it when isWriting is true.
public SendNext ( object obj ) : void
obj object
Résultat void

Serialize() public méthode

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( PhotonPlayer, &obj ) : void
obj PhotonPlayer,
Résultat void

Serialize() public méthode

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( Quaternion &obj ) : void
obj Quaternion
Résultat void

Serialize() public méthode

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( Vector2 &obj ) : void
obj Vector2
Résultat void

Serialize() public méthode

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( Vector3 &obj ) : void
obj Vector3
Résultat void

Serialize() public méthode

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( bool &myBool ) : void
myBool bool
Résultat void

Serialize() public méthode

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( char &value ) : void
value char
Résultat void

Serialize() public méthode

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( float &obj ) : void
obj float
Résultat void

Serialize() public méthode

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( int &myInt ) : void
myInt int
Résultat void

Serialize() public méthode

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( short &value ) : void
value short
Résultat void

Serialize() public méthode

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( string &value ) : void
value string
Résultat void

ToArray() public méthode

Turns the stream into a new object[].
public ToArray ( ) : object[]
Résultat object[]