Beispiel #1
0
    private void Update()
    {
        if (isTransferring)
        {
            if (Reader.Loaded)
            {
                if (sizeToTransfer > 0)                 // loading
                {
                    sizeToTransfer -= TransferSpeed * Time.deltaTime;
                    Loading.UpdateBarProgress((float)Mathf.Abs(1 - (sizeToTransfer / Viewer.currentFile.Size)));
                }
                if (sizeToTransfer <= 0)                 // loading finished
                {
                    EndLoading();

                    TransferForReal();
                }
            }
            else
            {
                if (sizeToTransfer > 0)                 // loading interrupted
                {
                    CancelTransfer();
                    DisplayMessage("Floppy removed!", true);
                }
            }
        }
    }