Beispiel #1
0
 public static void ReadPersistentText(string _file
                                       , OnReadTextSuccessDelegate _onSuccess
                                       , OnErrorDelegate _onError)
 {
     if (string.IsNullOrEmpty(_file))
     {
         _onError("file is null");
         return;
     }
     CoroutineMgr.Start(readPersistentText(_file, _onSuccess, _onError));
 }
Beispiel #2
0
        private static IEnumerator readStreamText(string _file, OnReadTextSuccessDelegate _onSuccess, OnErrorDelegate _onError)
        {
            string path = Path.Combine(VRXX.Platform.GetStreamingAssetsPath(), _file);

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

            yield return(www);

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