예제 #1
0
    // Update is called once per frame
    void Update()
    {
        string text = "Datafiles: " + cDT.sentFiles.ToString() + "/" + cDT.expectedFiles.ToString() + "\n";

        text += "Art Assets: " + iDT.sentFiles.ToString() + "/" + iDT.expectedFiles.ToString() + "\n";
        text += "Manifest: " + mE.sentData.ToString() + "/" + mE.expectedDataCount.ToString() + "\n";

        text += LoadedData.GetCurrentTimestamp();
        LoadedData.GetSingleton <UIDrawer>().GetTypeInElement <Text>(progressOfFiles).text = text;

        if (cDT.sentFiles == cDT.expectedFiles && iDT.sentFiles == iDT.expectedFiles && startInitiated && mE.expectedDataCount == mE.sentData)
        {
            SceneTransitionData.LoadScene("Gameplay");
        }
    }
예제 #2
0
    public void SendEncodedMessages()
    {
        byte[] eT    = BitConverter.GetBytes(encoderId);
        byte[] cId   = BitConverter.GetBytes(ClientProgram.clientId);
        byte[] tS    = BitConverter.GetBytes(LoadedData.GetCurrentTimestamp());
        byte[] nwMsg = new byte[bytesToSend.Length + 16];

        Buffer.BlockCopy(eT, 0, nwMsg, 0, 4);
        Buffer.BlockCopy(cId, 0, nwMsg, 4, 4);
        Buffer.BlockCopy(tS, 0, nwMsg, 8, 8);
        Buffer.BlockCopy(bytesToSend, 0, nwMsg, 16, bytesToSend.Length);

        if (ClientProgram.clientInst != null)
        {
            ClientProgram.clientInst.AddNetworkMessage(nwMsg);
        }
    }