Skip to content

The plugin won't initiate download if the downloading has been intiated once #19

Open

Description

@bhavin2707

Hi, so I was developing a puzzle game that uses this plugin as it's a perfect fit. I am downloading the images from google drive at runtime. In the many, I have a script to download the levels sequentially in the background, but the problem occurs when I change the scene, and when I come back, the plugin just won't download the levels. it gets stuck where it was left off. This breaks the flow of downloading the levels and to continue, have to restart the app.

Any suggestions on how to fix it?

Activity

  1. ReneB commented on Nov 8, 2022

    @ReneB

    FWIW, I think I've locally fixed this by adding an OnDestroy() method to the Davinci.cs file, like this:

        private void OnDestroy()
        {
            if (underProcessDavincies.ContainsKey(uniqueHash) && underProcessDavincies[uniqueHash] == this) {
                if (enableLog)
                    Debug.Log("[Davinci] Removing Davinci object while download unfinished: " + uniqueHash);
    
                underProcessDavincies.Remove(uniqueHash);
            }
        }
    

    I have not yet been able to test this outside of our own use case, where it seems to fix an issue similar to that of @bhavin2707, but I think I understand the code well enough to determine that the code above makes sure that the Davinci instance being destroyed is the one that any other possible Davinci instances that were waiting for the same file have set their hopes on for getting the file, so if this one is being Destroy()ed, no other Davinci instance should be registered for this specific uniqueHash anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions