Esempio n. 1
0
    // Send spawn command to AR players
    public void SendSpawn(int x, int y, int z)
    {
        BuildCoder encoder = new BuildCoder(52);

        encoder.AddCube(x, y, z);
        Debug.Log("There are now " + encoder.getCount() + " items");
        foreach (KeyValuePair <int, GameObject> player in ARPlayers)
        {
            Send(player.Key, myReliableChannelId, encoder.getArray());                                      // Send serialized information down the reliable channel
        }
    }
Esempio n. 2
0
 // Function for sending a spawn request to the server from a client
 public bool RequestSpawn(int x, int y, int z)
 {
     if (!isHost)
     {
         BuildCoder encoder = new BuildCoder(52);
         encoder.AddCube(x, y, z);
         Send(hostId, myReliableChannelId, encoder.getArray());         // Send message to VR server
         return(true);
     }
     return(false);
 }