C# Класс 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.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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[].

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

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

Read next piece of data from the stream without advancing the "current" item.
public PeekNext ( ) : object
Результат object

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

Creates a stream and initializes it. Used by PUN internally.
public PhotonStream ( bool write, object incomingData ) : System
write bool
incomingData object
Результат System

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

Read next piece of data from the stream when isReading is true.
public ReceiveNext ( ) : object
Результат object

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

Add another piece of data to send it when isWriting is true.
public SendNext ( object obj ) : void
obj object
Результат void

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

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( PhotonPlayer, &obj ) : void
obj PhotonPlayer,
Результат void

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

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( Quaternion &obj ) : void
obj Quaternion
Результат void

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

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( Vector2 &obj ) : void
obj Vector2
Результат void

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

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( Vector3 &obj ) : void
obj Vector3
Результат void

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

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( bool &myBool ) : void
myBool bool
Результат void

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

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( char &value ) : void
value char
Результат void

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

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( float &obj ) : void
obj float
Результат void

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

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( int &myInt ) : void
myInt int
Результат void

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

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( short &value ) : void
value short
Результат void

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

Will read or write the value, depending on the stream's isWriting value.
public Serialize ( string &value ) : void
value string
Результат void

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

Turns the stream into a new object[].
public ToArray ( ) : object[]
Результат object[]