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)); }
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); }