public void ClearContents(ARGEnum.ContentsType type) { #if UNITY_ANDROID pluginClass.Call("clearContent", (int)type); #elif UNITY_IOS ARGearClearContents((int)type); #endif }
public void SaveFile(ARGEnum.ContentsType type, string uuid, byte[] bytes) { string destination = Application.persistentDataPath + "/" + uuid; if (File.Exists(destination)) { File.Delete(destination); } File.WriteAllBytes(destination, bytes); _onDownloadComplete(type, uuid); }
private void DownloadComplete(ARGEnum.ContentsType type, string uuid) { ARGearManager.Instance.SetItem(type, Application.persistentDataPath + "/" + uuid, uuid, new ARGearContentsCallback( success => { // success }, error => { // error } )); }
public IEnumerator DownloadFileRoutine(ARGEnum.ContentsType type, string url, string uuid) { UnityWebRequest request = UnityWebRequest.Get(url); yield return(request.SendWebRequest()); if (request.isNetworkError) { Debug.Log("DownloadError"); } else { SaveFile(type, uuid, request.downloadHandler.data); } }
public void SetItem( ARGEnum.ContentsType type, string path, string uuid, ARGearContentsCallback callback1 = null, ARGearAndroidContentsCallback callback2 = null) { #if UNITY_ANDROID if (pluginClass == null) { return; } pluginClass.Call("setItem", (int)type, path, uuid, callback2); #elif UNITY_IOS ARGeariOSCallback.argearContentsCallback = callback1; ARGearSetItem((int)type, path, uuid, ARGeariOSCallback.contentsLoadingResult); #endif }
public void SetItem(ARGEnum.ContentsType type, string filePath, string uuid, ARGearContentsCallback callback = null) { #if UNITY_ANDROID ARGearNative.SetItem(type, filePath, uuid, null, new ARGearAndroidContentsCallback( success => { if (callback != null) { callback.OnSuccess(); } }, error => { if (callback != null) { callback.OnError(error); } } )); #elif UNITY_IOS ARGearNative.SetItem(type, filePath, uuid, callback); #endif }
public void ClearContents(ARGEnum.ContentsType type) { ARGearNative.ClearContents(type); }
public void SetItem(ARGEnum.ContentsType type, string filePath, string uuid) { ARGearNative.SetItem(type, filePath, uuid); }
public void StartDownload(ARGEnum.ContentsType type, string url, string uuid) { StartCoroutine(DownloadFileRoutine(type, url, uuid)); }