Example #1
0
 public static void ReadPersistentImage(string _uuid
                                        , OnLoadImageSuccessDelegate _onSuccess
                                        , OnErrorDelegate _onError)
 {
     if (string.IsNullOrEmpty(_uuid))
     {
         _onError("file is null");
         return;
     }
     CoroutineMgr.Start(readPersistentImage(_uuid, _onSuccess, _onError));
 }
Example #2
0
        private static IEnumerator readPersistentImage(string _file, OnLoadImageSuccessDelegate _onSuccess, OnErrorDelegate _onError)
        {
            string path = Path.Combine(VRXX.Platform.GetPersistentDataPath(), _file);

            Log.Debug("ResourceMgr", "read image [{0}] from [{1}]", _file, path);
            WWW www = new WWW(path);

            yield return(www);

            if (www.error != null)
            {
                _onError(www.error);
                yield break;
            }
            _onSuccess(www.texture);
        }