Çağatay Kaya February 2016

How to send a photo over network with Unity?

I am trying to show the players Facebook profile picture each other when they are playing vs game. I tried to send the picture with [Command] and [ClientRpcCall] attributes but do not work. Any idea?

Answers


Joe Blow February 2016

It's trivial to google an answer to this question.

To get you started something like ...

[RPC]
void SendTextures(byte[] receivedByte){
 receivedTexture = null;
 receivedTexture = new Texture2D(1, 1);
 receivedTexture.LoadImage(receivedByte);
 GetComponent<Renderer>().material.mainTexture = receivedTexture;
 }

Just google for 100s of full examples and discussions.

Here's a huge discussion with many full scripts and so on

http://forum.unity3d.com/threads/sync-texture-over-network.76538/

Try googling,

Unity3D send image over RPC

Unity3D send PNG over RPC

Unity3D texture RPC

and so on

Post Status

Asked in February 2016
Viewed 3,741 times
Voted 14
Answered 1 times

Search




Leave an answer