Esempio n. 1
0
            public void GetAsync(string url, Action <UnityEngine.Networking.DownloadHandler> OnCompleted, Action <string> OnFail)
            {
                if (mockedContent.ContainsKey(url))
                {
                    var buffer = new Mocked.DownloadHandler();
                    buffer.mockedText = mockedContent[url];
                    OnCompleted?.Invoke(buffer);
                    return;
                }

                OnFail?.Invoke("Url not found!");
            }
Esempio n. 2
0
            public UnityEngine.Networking.DownloadHandler Get(string url)
            {
                var buffer = new Mocked.DownloadHandler();

                if (!mockedContent.ContainsKey(url))
                {
                    throw new HttpRequestException($"Mocked 404 -- ({url})");
                }

                buffer.mockedText = mockedContent[url];
                return(buffer);
            }