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.
Mostra file Open project: repelex/Droid-Soccer Class Usage Examples

Public Methods

Method 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 method

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

PhotonStream() public method

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

ReceiveNext() public method

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

SendNext() public method

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

Serialize() public method

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

Serialize() public method

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

Serialize() public method

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

Serialize() public method

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

Serialize() public method

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

Serialize() public method

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

Serialize() public method

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

Serialize() public method

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

Serialize() public method

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

Serialize() public method

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

ToArray() public method

Turns the stream into a new object[].
public ToArray ( ) : object[]
return object[]