This addon shows how to share images data with
- either at the creation of an image: the image is sent to all connected users
- or upon the connection of a user joining the session late: the image is sent to this user only.
StreamTextureManager must be included in the scene, ideally under the
NetworkRunner hierarchy (otherwise, its
runner attribute has to be defined).
To send an image, use `StreamTextureManager.SendTexture(textureReceiver, textureData, allPlayers), with:
textureReceiver: a component implementing
Objectto be able to find a network object to which forward the data when they are received, and
ReceiveTexture(Texture2D texture)through which the actual texture is received
texture: can be either a
Texture2D, or a byte array
players: a list of players to which send the data
To illustrate the usage, the
CameraPicture component can receive locally an image (from a
PhotoRecorder component), and will then forward it to all connected users.
If a user joins late, the state authority will forward the image data to this user only. A check in the
FixedUpdateNetwork ensures that there is always a state authority (if the original author leaves).
The demo scene can be found in
To shoot a picture, select the PhotoRecorder, once connected, and click on the
Shoot picture button in the inspector, on the
This addon latest version is included into the addon project
- shared mode
- Version 1.0.1: Fix demo scene + add namespace
- Version 1.0.0: First release