IEnumerator WaitForCancel(LobbyPlayer thisPlayerInfo)
    {
        int w = v.width;
        int h = v.height;

        byte[] data = v.imageData;
        int    size = v.imageSize;

        thisPlayerInfo.width     = 0;
        thisPlayerInfo.height    = 0;
        thisPlayerInfo.imageSize = 0;
        thisPlayerInfo.RpcSendImage(null, true, true);

        yield return(new WaitForSeconds(0.2f));

        v.width     = w;
        v.height    = h;
        v.imageData = data;
        v.imageSize = size;
        loadImage(v.imageData, v.width, v.height);

        sending          = false;
        AlreadySendImage = false;
        SendImageButton.GetComponentInChildren <Text> ().text = "Resend\nImage";
        SendingPanel.SetActive(false);
    }
    IEnumerator WaitAndSendImage(LobbyPlayer thisPlayerInfo, byte[] data)
    {
        sending = true;

        int bufferSize = 30000;
        int time       = (data.Length % bufferSize != 0) ? Mathf.FloorToInt(data.Length / bufferSize) + 1 : Mathf.FloorToInt(data.Length / bufferSize);

        Debug.Log(data.Length + " => " + time);

        byte[] first;
        if (data.Length <= bufferSize)
        {
            first = new byte[data.Length];
            for (int j = 0; j < data.Length; j++)
            {
                first [j] = data [j];
            }
            if (sending == true)
            {
                thisPlayerInfo.RpcSendImage(first, true, true);
            }
        }
        else
        {
            first = new byte[bufferSize];
            for (int j = 0; j < first.Length; j++)
            {
                first [j] = data [j];
            }
            if (sending == true)
            {
                thisPlayerInfo.RpcSendImage(first, true, false);
            }
        }

        for (int i = 1; i < time - 1; i++)
        {
            byte[] temp = new byte[bufferSize];
            for (int j = i * bufferSize, k = 0; j < (i + 1) * bufferSize; j++, k++)
            {
                temp [k] = data [j];
            }

            yield return(new WaitForSeconds(0.3f));

            if (sending == true)
            {
                thisPlayerInfo.RpcSendImage(temp, false, false);
            }
        }

        if (data.Length > bufferSize)
        {
            byte[] last = new byte[data.Length - (time - 1) * bufferSize];
            for (int j = (time - 1) * bufferSize, k = 0; j < data.Length; j++, k++)
            {
                last [k] = data [j];
            }

            yield return(new WaitForSeconds(0.3f));

            if (sending == true)
            {
                thisPlayerInfo.RpcSendImage(last, false, true);
            }
        }

        sending          = false;
        AlreadySendImage = true;
        SendImageButton.GetComponentInChildren <Text> ().text = "Resend\nImage";
    }