Exemplo n.º 1
0
        public void Initialize()
        {
                        #if !UNITY_EDITOR
            RefreshOnResume = true;
                        #endif
            _isInitialized  = true;
            _networkManager = gameObject.AddComponent <ITTNetworkManager>();
            _networkManager.SessionManager = new ITTSessionBlob();

            // Try pulling data from the previous session first.
            DeserializeDataBlob();
            DeserializeSession();
        }
Exemplo n.º 2
0
        public void StartImageDownload(Action <Texture2D> onImageDownloaded,
                                       Action onImageDownloadFailed,
                                       string imageURL = null)
        {
            string url;

            if (null == imageURL)
            {
                if (null == image)
                {
                    return;
                }
                if (!string.IsNullOrEmpty(image.serving_url))
                {
                    url = image.serving_url;
                }
                else
                {
                    return;
                }
            }
            else
            {
                url = imageURL;
            }
            OnImageDownloaded     = onImageDownloaded;
            OnImageDownloadFailed = onImageDownloadFailed;
            string sanitizedImageURL = ITTNetworkManager.SanitizeImageURL(url);

            if (!string.IsNullOrEmpty(sanitizedImageURL))
            {
                ITTDataCache.Instance.StartDownloadImage(sanitizedImageURL, ImportImage, ImportFailed);
            }
            else
            {
                ImportFailed("URL is null");
            }
        }