Version: 2021.3
언어: 한국어
protected bool ReceiveData (byte[] data, int dataLength);

파라미터

data A buffer containing unprocessed data, received from the remote server.
dataLength The number of bytes in data which are new.

반환

bool True if the download should continue, false to abort.

설명

Callback, invoked as data is received from the remote server.

This callback is invoked on the main thread.

Data arriving from the remote server for a DownloadHandlerScript is kept in a temporary ringbuffer.

When there is unprocessed data in the buffer, this method will be called once per frame to hand chunks of that data to script. (If multiple datagrams arrive within one frame, they will be combined before being passed to this callback.) The data byte array contains the received data.

When operating in non-preallocated mode, the system will allocate a new byte array each time this callback is invoked. In this case, data.Length will be equal to dataLength, and you may safely ignore the dataLength argument.

When operating in preallocated mode, the data argument will be the byte array passed in at construction time, and the dataLength argument indicates which bytes in the byte array are new. (Important: The system does not zero-out the array between calls.)

See DownloadHandlerScript.ctor for more information on allocation modes.