Пример #1
0
    void SendDataToPlayers()
    {
        string dataToSend = "";

        foreach (GameObject[] GOarray in WallArray)
        {
            foreach (GameObject GO in GOarray)
            {
                WallScript ws = GO.GetComponent <WallScript>();
                int        r  = ws.getRow();
                int        c  = ws.getCol();
                dataToSend += r + "," + c + "," + ws.GetHeight() + "|";
            }

            dataToSend = dataToSend.Substring(0, dataToSend.Length - 1);
            //Debug.Log("Sending data: "+ dataToSend);
            networkView.RPC("setMaze", RPCMode.Others, dataToSend);
            dataToSend = "";

            //Had to send the data at the end of every Row, turns out
            //that 4080 something characters was the maximum string allowed
            //to be sent through RPC calls.
        }

        networkView.RPC("setMaze", RPCMode.Others, "DONE");
    }