Пример #1
0
    public void DownloadAsync()
    {
        DownloadConfig config = new DownloadConfig()
        {
            URL           = Url,
            GUID          = "TestFile",
            CacheFilePath = Application.dataPath + "/TestFile"
        };

        loader = new FileDownLoader(config)
        {
            Async = true
        };
        loader.OnComplete.AddEventListener((l) =>
        {
            Debug.Log("Complete filepath:" + loader.config.CacheFilePath);
        });
        loader.OnError.AddEventListener((l) =>
        {
            Debug.Log(loader.ErrorStr);
        });
        loader.OnCancel.AddEventListener((l) =>
        {
            Debug.Log("OnCancel");
        });
        loader.Execute();
        Debug.Log("Call End");
    }
Пример #2
0
    public void Download()
    {
        DownloadConfig config = new DownloadConfig()
        {
            URL           = Url,
            GUID          = "TestFile",
            CacheFilePath = Application.dataPath + "/TestFile"
        };

        downLoader = new FileDownLoader(config);
        downLoader.OnError.AddEventListener((l) =>
        {
            Debug.Log(l.ErrorStr);
        });
        downLoader.OnComplete.AddEventListener((l) =>
        {
            Debug.Log("Complete filepath:" + (l as FileDownLoader).config.CacheFilePath);
        });
        downLoader.Execute();
        Debug.Log("Call End");
    }