- Home /
Question by
OrdinaryDev83 · Oct 28, 2017 at 08:52 PM ·
c#multiplayer
Unity UNET : Send some data between two players
Hello, I would like to send only some data between 2 players in wifi without bothering with NetworkIdentifier or things like that. I would also like to get info from the other player's connection. I would like to send:
Classes
values types...
connection status
Example:
Player otherPlayer;
public void Match(Player player){
otherPlayer = player;
}
public void SendItem(Item item){
if(!IsConnected()){
Debug.LogError ("Lost connection");
return;
}
otherPlayer.ReceiveItem (item);
}
public bool IsConnected(){
//example status enum...
if (otherPlayer.connectionStatus != Connection.Status.Connected) {
return false;
}
return true;
}
Thanks in advance!
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How does one restart the scene in Unet Multiplayer without the player object respawning? 0 Answers
UWP and HLAPI 0 Answers