public static Boolean CheckForUpdate(bool ForceCheck, bool versionSpecific) { #if DEBUG string updateSite = "http://magico13.net/KCT/latest_beta"; #else string updateSite = versionSpecific ? "http://magico13.net/KCT/latest-1-0-0" : "http://magico13.net/KCT/latest"; #endif if (ForceCheck || WebVersion == "") { Debug.Log("[KCT] Checking for updates..."); WWW www = new WWW(updateSite); while (!www.isDone) { } WebVersion = www.text.Trim(); Debug.Log("[KCT] Received version: " + WebVersion); if (WebVersion == "") UpdateFound = false; else { System.Version webV = new System.Version(WebVersion); UpdateFound = (new System.Version(CurrentVersion).CompareTo(webV) < 0); } } if (UpdateFound) Debug.Log("[KCT] Update found: "+WebVersion+" Current: "+CurrentVersion); else Debug.Log("[KCT] No new updates. Current: " + CurrentVersion); return UpdateFound; }
public IEnumerator SendCoroutine() { AddDefaultParameters(); WWWForm requestForm = new WWWForm (); requestForm.AddField ("name", this.eventName); requestForm.AddField ("data", this.data.ToString ()); if (!this.customData.IsNull) { requestForm.AddField ("customData", this.customData.Print(false)); } else { requestForm.AddField ("customData", "{}"); } requestForm.AddField ("ts", "1470057439857"); requestForm.AddField ("queued", 0); requestForm.AddField ("debugMode", "true"); WWW request = new WWW ("https://apptracker.spilgames.com/v1/native-events/event/android/" + Spil.BundleIdEditor + "/" + this.eventName, requestForm); yield return request; // while (!request.isDone); if (request.error != null) { Debug.LogError ("Error getting data: " + request.error); Debug.LogError ("Error getting data: " + request.text); } else { JSONObject serverResponse = new JSONObject (request.text); Debug.Log ("Data returned: " + serverResponse.ToString()); ResponseEvent.Build(serverResponse); } }
static void DownloadCompleted() { EditorUtility.ClearProgressBar (); if (Main.IsDebug) { UnityEngine.Debug.Log ("Python downloaded: " + www.size.ToString ()); } string dir = System.Environment.GetFolderPath (System.Environment.SpecialFolder.ApplicationData); string localFile = dir + PythonManager.GetPythonFileName (); try { System.IO.FileStream stream = new System.IO.FileStream (localFile, System.IO.FileMode.Create, System.IO.FileAccess.Write); stream.Write (www.bytes, 0, www.bytes.Length); // close file stream stream.Close (); www = null; } catch(Exception ex) { if(Main.IsDebug) { UnityEngine.Debug.LogError("Python download failed: " + ex.Message); } } Install(); }
public static bool LoadPath(string filePath) { if (!string.IsNullOrEmpty(filePath)) { string text = string.Empty; try { if (filePath.Contains("://")) { WWW www = new WWW(filePath); while (!www.isDone) ; text = www.text; } else { if (File.Exists(filePath)) { StreamReader file = File.OpenText(filePath); text = file.ReadToEnd(); file.Close(); } } } catch (Exception e) { UnityEngine.Debug.LogErrorFormat("Error Loading File [{0}]", filePath); return false; } return LoadText(text); } return false; }
public IEnumerator LoadNextImageInfo() { // load from json api string pageUrl = JSON_BASE_URL + currentPage; Debug.Log ("[JplImageInfoLoader] LoadNextImageInfo: " + pageUrl); WWW www = new WWW (pageUrl); yield return www; if (www.error == null) { // parse to list Root jsonRoot = JsonUtility.FromJson<Root> (www.text); imageDataList = new List<ImageData> (); foreach (Item item in jsonRoot.items) { imageDataList.Add (ConstructImageData (item)); } // start all over again if we reached the end of pages if (jsonRoot.more) { currentPage++; } else { currentPage = 0; } error = null; } else { error = www.error; } }
public IEnumerator LoadAssetBundle() { state = DownloadState.Init; downLoader = new WWW(path + fileName); state = DownloadState.Loading; yield return downLoader; if(downLoader.error!=null) { state = DownloadState.LoadFailed; downLoader.Dispose(); yield break; } else { size = downLoader.bytesDownloaded; assetBundle = downLoader.assetBundle; if(assetBundle==null) { state = DownloadState.LoadFailed; } else { state = DownloadState.Loaded; } downLoader.Dispose(); } }
private IEnumerator getAdPlan(string url, System.Action<WWW> callback) { WWW www = new WWW(url); yield return www; callback(www); }
//private const string CommentUrl = "http://localhost:52542/api/comments"; public IEnumerator GetComments(Action<List<UserComment>> resultAction) { var commentWWW = new WWW(CommentUrl); yield return commentWWW; var commentList = JsonConvert.DeserializeObject<List<UserComment>>(commentWWW.text); resultAction(commentList); }
public IEnumerator PostComment(UserComment comment, Action<bool> resultAction) { var jsonString = JsonConvert.SerializeObject(comment); var headers = new Dictionary<string, string>(); headers.Add("Content-Type", "text/json"); var encoding = new UTF8Encoding(); var request = new WWW(CommentUrl, encoding.GetBytes(jsonString), headers); yield return request; if (request.error != null) { Debug.Log("Error:" + request.error); resultAction(false); } else { Debug.Log("Request Successful"); Debug.Log(request.text); resultAction(true); } }
public override void Load() { //Debug.Log ("Downloading " + filePath); // TODO: image caching www = new WWW(this.filePath); }
public static string ReadStreamingAssetsFile(string fileRelativePath) { string assetsFilePath = System.IO.Path.Combine (Application.streamingAssetsPath, fileRelativePath); try { if (assetsFilePath.Contains ("jar:file") || assetsFilePath.Contains ("://")) { // Android int timeout = 7; // seconds System.DateTime startTime = System.DateTime.Now; WWW www = new WWW (assetsFilePath); Debug.Log ("trying to read file: " + assetsFilePath); while (!www.isDone) { TimeSpan interval = DateTime.Now - startTime; if (interval.Seconds > timeout) return null; } if (!String.IsNullOrEmpty (www.error)) { return null; } return System.Text.Encoding.UTF8.GetString (www.bytes); } else { if (!System.IO.File.Exists (assetsFilePath)) return null; string config = System.IO.File.ReadAllText (assetsFilePath); return config; } } catch (System.Exception e) { Debug.LogException (e); } return null; }
IEnumerator Hoge() { var www = new WWW("http://google.co.jp/"); Debug.Log("W"); yield return www; Debug.Log(www.text); }
IEnumerator DownloadAsTexture(ImageData imageData) { Debug.Log ("[JplImageLoader] download next image: " + imageData.Url); WWW www = new WWW (imageData.Url); while (www.progress < 1 && onImageLoadingProgress != null) { onImageLoadingProgress (www.progress); yield return null; } yield return www; if (www.error == null) { imageData.Texture = www.texture; if (onImageLoadingComplete != null) { onImageLoadingComplete (imageData); } } else { if (onImageLoadingError != null) { onImageLoadingError (www.error); } } }
public void LoadTexture(String relativePath, ref Texture2D targetTexture) { var imageLoader = new WWW("file://" + root + relativePath); imageLoader.LoadImageIntoTexture(targetTexture); if (imageLoader.isDone && imageLoader.size == 0) allTexturesFound = false; }
public WWW GET(string url,Action<WWW> action) { CancelFlag = false; WWW www = new WWW(url); EditorCoroutine.start(ProcessRequest(www,action)); return www; }
public void Post(string url, Action<JSONObject> success, Action<string> error) { WWWForm form = new WWWForm(); WWW www = new WWW(api + url, form); StartCoroutine(WaitForRequest(www, success, error)); }
public static void Download() { string url = PythonManager.GetPythonDownloadUrl (); www = new WWW (url); EditorApplication.update = WhileDownloading; }
static public IEnumerator SendPostRequest(string url, byte[] data, Dictionary<string, string> headers, System.Action<WWW> callback, System.Action<string> errorCallback) { System.Collections.Generic.Dictionary<string, string> defaultHeaders = new System.Collections.Generic.Dictionary<string, string>(); ; if (data != null) { defaultHeaders.Add("Content-Type", "application/octet-stream"); defaultHeaders.Add("Content-Length", data.Length.ToString()); } if (headers != null) { foreach(KeyValuePair<string, string> pair in headers) { defaultHeaders.Add(pair.Key, pair.Value); } } WWW www = new WWW(url, data, defaultHeaders); yield return www; if (!System.String.IsNullOrEmpty(www.error)) { if (errorCallback != null) { errorCallback(www.error); } } else { callback(www); } }
IEnumerator PostJSON(string url){ string jsonString = "{\"itemName\":\"Spear\",\"itemType\":\"aa\",\"price\":30000,\"attack\":100,\"defense\":0,\"description\":\"10000\"}"; // HEADERはHashtableで記述 Hashtable header = new Hashtable (); header.Add ("Content-Type", "text/json"); header.Add("Content-Length", jsonString.Length); var encording = new System.Text.UTF8Encoding (); print("jsonString: " + jsonString); // 送信開始 var request = new WWW (url, encording.GetBytes(jsonString), header); yield return request; // 成功 if (request.error == null) { Debug.Log("WWW Ok!: " + request.data); } // 失敗 else{ Debug.Log("WWW Error: "+ request.error); } }
public IEnumerator CreateTile(World w, Vector2 realPos, Vector2 worldCenter, int zoom) { var tilename = realPos.x + "_" + realPos.y; var tileurl = realPos.x + "/" + realPos.y; var url = "http://vector.mapzen.com/osm/water,earth,buildings,roads,landuse/" + zoom + "/"; JSONObject mapData; if (File.Exists(tilename) || offline) { var r = new StreamReader(tilename, Encoding.Default); mapData = new JSONObject(r.ReadToEnd()); } else { var www = new WWW(url + tileurl + ".json"); yield return www; var sr = File.CreateText(tilename); sr.Write(www.text); sr.Close(); mapData = new JSONObject(www.text); } Rect = GM.TileBounds(realPos, zoom); CreateBuildings(mapData["buildings"]); CreateRoads(mapData["roads"]); }
public override bool IsDone() { if (this.dependences != null) { for (int i = 0; i < this.dependences.Length; ++i) { if (!ResMgr.Instance().IsLoadedAssetBundle(this.dependences[i])) return false; } } if (this.op != null) { return this.op.isDone; } else { if (this.www.isDone) { this.assetbundle = this.www.assetBundle; string scene = base.SceneName.Substring(0, base.SceneName.LastIndexOf('.')); if (this.additive) this.op = Application.LoadLevelAdditiveAsync(scene); else this.op = Application.LoadLevelAsync(scene); this.www.Dispose(); this.www = null; } return false; } }
static IEnumerator FetchBytes(WWW www, IObserver<byte[]> observer, IProgress<float> reportProgress, CancellationToken cancel) { using (www) { while (!www.isDone && !cancel.IsCancellationRequested) { if (reportProgress != null) { try { reportProgress.Report(www.progress); } catch (Exception ex) { observer.OnError(ex); yield break; } } yield return null; } if (cancel.IsCancellationRequested) yield break; if (!string.IsNullOrEmpty(www.error)) { observer.OnError(new Exception(www.error)); } else { observer.OnNext(www.bytes); observer.OnCompleted(); } } }
protected override IEnumerator GenerateLoadProcess() { string target = GetPlatformFolderForAssetBundles (); string baseUrl = Path.Combine (ResourceManager.Instance.assetBundleDomain, target); string manifestUrl = Path.Combine (baseUrl, target); using (WWW www = new WWW (manifestUrl)) { while (www.progress < 1.0f || www.isDone == false) { progress = www.progress; yield return null; } if (www.assetBundle == null) { Failed (www.error); yield break; } AssetBundleRequest async = www.assetBundle.LoadAssetAsync ("AssetBundleManifest"); while (async.progress < 0.9f || async.isDone == false) { yield return null; } if (async.asset == null) { Failed ("AssetBundle.LoadAssetAsync"); yield break; } assetBundleManifest = async.asset as AssetBundleManifest; Successed (); } }
public static Boolean CheckForUpdate(bool ForceCheck, bool versionSpecific) { string updateSite = versionSpecific ? "http://magico13.net/KCT/latest-0-24-0" : "http://magico13.net/KCT/latest"; //System.Version current = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; //CurrentVersion = current.ToString(); if (ForceCheck || WebVersion == "") { Debug.Log("[KCT] Checking for updates..."); WWW www = new WWW(updateSite); while (!www.isDone) { } WebVersion = www.text.Trim(); //Debug.Log("[KCT] Current version: " + CurrentVersion); Debug.Log("[KCT] Received version: " + WebVersion); if (WebVersion == "") UpdateFound = false; else { System.Version webV = new System.Version(WebVersion); UpdateFound = (new System.Version(CurrentVersion).CompareTo(webV) < 0);//CompareVersions(WebVersion, CurrentVersion); } } if (UpdateFound) Debug.Log("[KCT] Update found: "+WebVersion+" Current: "+CurrentVersion); else Debug.Log("[KCT] No new updates. Current: " + CurrentVersion); return UpdateFound; }
public void BeginLoad(CRequest req) { this.isFree = false; this._req = req; this.enabled = true; string url = req.url; if (url.IndexOf("://") == -1) { url = "file://" + url; } if (req.head is WWWForm) { www = new WWW(url, (WWWForm)req.head); } else if (req.head is byte[]) { www = new WWW(url, (byte[])req.head); } else { // if (url.StartsWith ("http")) { // if(CResLoader.assetBundleManifest!=null) // www = WWW.LoadFromCacheOrDownload (url, CResLoader.assetBundleManifest.GetAssetBundleHash (req.assetBundleName), 0); // else // www = WWW.LoadFromCacheOrDownload (url, 0); // } // else www = new WWW(url); } //Debug.LogFormat("<color=green> begin load {0} </color>", url); }
private void LoadExternalCoroutine(string name, UIImage image) { string url = "file://" + GameManager.Instance.mainGame.ExternalResourcePath + "/" + name + ".jpg"; Debug.Log(name); WWW www = new WWW(url); if (string.IsNullOrEmpty(www.error)) { www.LoadImageIntoTexture(loaderTexture); Sprite sprite = Sprite.Create(loaderTexture, new Rect(0, 0, loaderTexture.width, loaderTexture.height), // new Rect(0, 0, www.texture.width, www.texture.height), //->this eat up memory!! new Vector2(0.5f, 0.5f), 100.0f); Sprite[] sprites = new Sprite[1]; sprites[0] = sprite; image.SetSprites(sprites); image.Sprite = 0; DestroyImmediate(www.texture); } else { Debug.LogWarning(www.error); image.SetSprites(UIManager.LoadSprite(name)); image.Sprite = 0; } www.Dispose(); www = null; }
IEnumerator GetNewTrades() { WWWForm form = new WWWForm(); form.AddField("_Token", APIKey); //The token form.AddField("Symbols", symbols); //The Symbols you want DateTimeOffset currentTimeEST = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, easternZone); form.AddField("StartDateTime", lastUpdatedEST.ToString(timeFormat)); //The proper DateTime in the proper format form.AddField("EndDateTime", currentTimeEST.AddTicks(-1000000).ToString(timeFormat)); //The proper DateTime in the proper format var url = "http://ws.nasdaqdod.com/v1/NASDAQTrades.asmx/GetTrades HTTP/1.1"; WWW www = new WWW(url, form); yield return www; if (www.error == null) { //Sucessfully loaded the JSON string Debug.Log("Loaded following JSON string" + www.text); } else { Debug.Log("ERROR: " + www.error); } }
static void CheckForUpdates() { string version; using (var stream = new FileStream(Application.dataPath + "/Plugins/Reign/VersionInfo/ReignVersionCheck", FileMode.Open, FileAccess.Read, FileShare.None)) using (var reader = new StreamReader(stream)) { version = reader.ReadLine(); } using (var www = new WWW("http://www.reign-studios-services.com/ReignUnityPluginUpdater/5/WebPluginCheckForUpdates.aspx?Version=" + version)) { while (!www.isDone) System.Threading.Thread.Sleep(1); if (!string.IsNullOrEmpty(www.error)) { Debug.LogError("Check for updates Error: " + www.error); return; } if (www.text == "CurrentVersion") { Debug.Log("You are up to date!"); EditorUtility.DisplayDialog("Current Version", "You are up to date!\nVersion: " + version, "OK"); } else if (www.text == "OldVersion") { Debug.LogError("Out of Date! Please download a updated Unitypackage!"); EditorUtility.DisplayDialog("Current Version", "Out of Date!\nPlease download a updated Unitypackage!", "OK"); } else { Debug.LogError("Invalid server response!"); } } }
private IEnumerator Request(SHKeyValue keyValue, string methodName, Action<string> valueReceived = null) { var url = string.Format (CultureInfo.InvariantCulture, "{0}/services/storage/{1}.ashx?playerId={2}&key={3}&value={4}", m_serverAddress, methodName, m_playerId, keyValue.Key, keyValue.Value); SHLog.Debug ("SHGlobalServerKeyValueStorageProvider: requesting url '{0}'.", url); var www = new WWW (url); yield return www; if (String.IsNullOrEmpty (www.error)) { var response = www.text; if (!String.IsNullOrEmpty (response)) { SHLog.Debug ("SHGlobalServerKeyValueStorageProvider: response received '{0}'.", response); if (valueReceived != null) { valueReceived (response.Replace("\"", "")); } } } else { SettingValueFailed.Raise (this, new SHSettingValueFailedEventArgs (keyValue)); } }
public static void StartLoadingData () { string BASE_DATA_PATH = "https://jetsons.firebaseio.com/gamedata/"; string PRETTY_COMMAND = "?print=pretty"; string url = BASE_DATA_PATH + "weapons.json" + PRETTY_COMMAND; Debug.Log("downloading from: " + url); WWW www = new WWW (url); while(!www.isDone); Debug.Log("downloading complete: " + url); if (www.error != null) { Debug.LogError ("can't load remote data: " + www.error); return; } Debug.Log("parsing config"); string json = www.text; var configList = DataUtils.CreateDataListFromJson<WeaponData> (json); if (configList != null) { Debug.Log("saving to file"); FileUtils.SaveFileToStreamingAssets("weapons.json", json); Debug.Log("saving complete!"); } }
static int get_size(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; int ret = obj.size; LuaDLL.lua_pushinteger(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index size on a nil value" : e.Message)); } }
static int get_audioClip(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; UnityEngine.AudioClip ret = obj.audioClip; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index audioClip on a nil value" : e.Message)); } }
static int set_threadPriority(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; UnityEngine.ThreadPriority arg0 = (UnityEngine.ThreadPriority)ToLua.CheckObject(L, 2, typeof(UnityEngine.ThreadPriority)); obj.threadPriority = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index threadPriority on a nil value")); } }
static int InitWWW(IntPtr L) { try { ToLua.CheckArgsCount(L, 4); UnityEngine.WWW obj = (UnityEngine.WWW)ToLua.CheckObject(L, 1, typeof(UnityEngine.WWW)); string arg0 = ToLua.CheckString(L, 2); byte[] arg1 = ToLua.CheckByteBuffer(L, 3); string[] arg2 = ToLua.CheckStringArray(L, 4); obj.InitWWW(arg0, arg1, arg2); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_assetBundle(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; UnityEngine.AssetBundle ret = obj.assetBundle; ToLua.PushSealed(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index assetBundle on a nil value")); } }
static int get_threadPriority(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; UnityEngine.ThreadPriority ret = obj.threadPriority; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index threadPriority on a nil value")); } }
static int get_bytesDownloaded(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; int ret = obj.bytesDownloaded; LuaDLL.lua_pushinteger(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index bytesDownloaded on a nil value")); } }
static int get_url(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; string ret = obj.url; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index url on a nil value")); } }
static int get_isDone(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; bool ret = obj.isDone; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index isDone on a nil value")); } }
static int get_uploadProgress(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; float ret = obj.uploadProgress; LuaDLL.lua_pushnumber(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index uploadProgress on a nil value")); } }
static int get_bytes(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; byte[] ret = obj.bytes; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index bytes on a nil value")); } }
static int get_textureNonReadable(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; UnityEngine.Texture2D ret = obj.textureNonReadable; ToLua.PushSealed(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index textureNonReadable on a nil value")); } }
static int get_error(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; string ret = obj.error; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index error on a nil value" : e.Message)); } }
static int get_responseHeaders(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; System.Collections.Generic.Dictionary <string, string> ret = obj.responseHeaders; ToLua.PushSealed(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index responseHeaders on a nil value")); } }
static int get_keepWaiting(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; bool ret = obj.keepWaiting; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index keepWaiting on a nil value" : e.Message)); } }
static int Dispose(IntPtr L) { #if UNITY_EDITOR ToluaProfiler.AddCallRecord("UnityEngine.WWW.Dispose"); #endif try { ToLua.CheckArgsCount(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)ToLua.CheckObject <UnityEngine.WWW>(L, 1); obj.Dispose(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int LoadImageIntoTexture(IntPtr L) { #if UNITY_EDITOR ToluaProfiler.AddCallRecord("UnityEngine.WWW.LoadImageIntoTexture"); #endif try { ToLua.CheckArgsCount(L, 2); UnityEngine.WWW obj = (UnityEngine.WWW)ToLua.CheckObject <UnityEngine.WWW>(L, 1); UnityEngine.Texture2D arg0 = (UnityEngine.Texture2D)ToLua.CheckObject(L, 2, typeof(UnityEngine.Texture2D)); obj.LoadImageIntoTexture(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int InitWWW(IntPtr l) { try{ UnityEngine.WWW self = (UnityEngine.WWW)checkSelf(l); System.String a1; checkType(l, 2, out a1); System.Byte[] a2; checkType(l, 3, out a2); System.String[] a3; checkType(l, 4, out a3); self.InitWWW(a1, a2, a3); return(0); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
static public int InitWWW(IntPtr l) { try { UnityEngine.WWW self = (UnityEngine.WWW)checkSelf(l); System.String a1; checkType(l, 2, out a1); System.Byte[] a2; checkArray(l, 3, out a2); System.String[] a3; checkArray(l, 4, out a3); self.InitWWW(a1, a2, a3); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
private IEnumerator DownloadConsentForms(string url, string pathToZip, string unzipFolder) { string exceptionMessage = null; using (UnityEngine.WWW www = new UnityEngine.WWW(url)){ while (!www.isDone) { ; } yield return(www); if (string.IsNullOrEmpty(www.error)) { try { if (!Directory.Exists(unzipFolder)) { Directory.CreateDirectory(unzipFolder); File.WriteAllBytes(pathToZip, www.bytes); ZipUtil.Unzip(pathToZip, unzipFolder); if (!File.Exists(unzipFolder + "/index.html")) { exceptionMessage = "Html for consent form not found. Something must have went wrong with the download process."; } File.Delete(pathToZip); } } catch (System.Exception e) { exceptionMessage = "Failed to write consent form zip to file system. Exception - " + e.Message; } } else { exceptionMessage = "Failed to retrieve consent form from server. Error - " + www.error; } if (exceptionMessage != null) { throw new System.Exception(exceptionMessage); } else { Debug.Log("Successfully downloaded consent and privacy forms"); } } }
static public int GetAudioClip(IntPtr l) { try{ if (matchType(l, 2, typeof(System.Boolean))) { UnityEngine.WWW self = (UnityEngine.WWW)checkSelf(l); System.Boolean a1; checkType(l, 2, out a1); UnityEngine.AudioClip ret = self.GetAudioClip(a1); pushValue(l, ret); return(1); } else if (matchType(l, 2, typeof(System.Boolean), typeof(System.Boolean))) { UnityEngine.WWW self = (UnityEngine.WWW)checkSelf(l); System.Boolean a1; checkType(l, 2, out a1); System.Boolean a2; checkType(l, 3, out a2); UnityEngine.AudioClip ret = self.GetAudioClip(a1, a2); pushValue(l, ret); return(1); } else if (matchType(l, 2, typeof(System.Boolean), typeof(System.Boolean), typeof(UnityEngine.AudioType))) { UnityEngine.WWW self = (UnityEngine.WWW)checkSelf(l); System.Boolean a1; checkType(l, 2, out a1); System.Boolean a2; checkType(l, 3, out a2); UnityEngine.AudioType a3; checkEnum(l, 4, out a3); UnityEngine.AudioClip ret = self.GetAudioClip(a1, a2, a3); pushValue(l, ret); return(1); } LuaDLL.luaL_error(l, "No matched override function to call"); return(0); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
static IEnumerator GetWWWCore(string url, IObserver <string> observer, CancellationToken cancellationToken) { var www = new UnityEngine.WWW(url); while (!www.isDone && !cancellationToken.IsCancellationRequested) { yield return(null); } if (www.error != null) { observer.OnError(new Exception(www.error)); } else { observer.OnNext(www.text); observer.OnCompleted(); } }
static int GetAudioClipCompressed(IntPtr L) { #if UNITY_EDITOR ToluaProfiler.AddCallRecord("UnityEngine.WWW.Register"); #endif try { int count = LuaDLL.lua_gettop(L); if (count == 1) { UnityEngine.WWW obj = (UnityEngine.WWW)ToLua.CheckObject <UnityEngine.WWW>(L, 1); UnityEngine.AudioClip o = obj.GetAudioClipCompressed(); ToLua.PushSealed(L, o); return(1); } else if (count == 2) { UnityEngine.WWW obj = (UnityEngine.WWW)ToLua.CheckObject <UnityEngine.WWW>(L, 1); bool arg0 = LuaDLL.luaL_checkboolean(L, 2); UnityEngine.AudioClip o = obj.GetAudioClipCompressed(arg0); ToLua.PushSealed(L, o); return(1); } else if (count == 3) { UnityEngine.WWW obj = (UnityEngine.WWW)ToLua.CheckObject <UnityEngine.WWW>(L, 1); bool arg0 = LuaDLL.luaL_checkboolean(L, 2); UnityEngine.AudioType arg1 = (UnityEngine.AudioType)ToLua.CheckObject(L, 3, typeof(UnityEngine.AudioType)); UnityEngine.AudioClip o = obj.GetAudioClipCompressed(arg0, arg1); ToLua.PushSealed(L, o); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.WWW.GetAudioClipCompressed")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetAudioClip(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.WWW), typeof(bool))) { UnityEngine.WWW obj = (UnityEngine.WWW)ToLua.ToObject(L, 1); bool arg0 = LuaDLL.lua_toboolean(L, 2); UnityEngine.AudioClip o = obj.GetAudioClip(arg0); ToLua.Push(L, o); return(1); } else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.WWW), typeof(bool), typeof(bool))) { UnityEngine.WWW obj = (UnityEngine.WWW)ToLua.ToObject(L, 1); bool arg0 = LuaDLL.lua_toboolean(L, 2); bool arg1 = LuaDLL.lua_toboolean(L, 3); UnityEngine.AudioClip o = obj.GetAudioClip(arg0, arg1); ToLua.Push(L, o); return(1); } else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.WWW), typeof(bool), typeof(bool), typeof(UnityEngine.AudioType))) { UnityEngine.WWW obj = (UnityEngine.WWW)ToLua.ToObject(L, 1); bool arg0 = LuaDLL.lua_toboolean(L, 2); bool arg1 = LuaDLL.lua_toboolean(L, 3); UnityEngine.AudioType arg2 = (UnityEngine.AudioType)ToLua.ToObject(L, 4); UnityEngine.AudioClip o = obj.GetAudioClip(arg0, arg1, arg2); ToLua.Push(L, o); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.WWW.GetAudioClip")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int _CreateUnityEngine_WWW(IntPtr L) { int count = LuaDLL.lua_gettop(L); if (count == 1) { string arg0 = ToLua.CheckString(L, 1); UnityEngine.WWW obj = new UnityEngine.WWW(arg0); ToLua.PushObject(L, obj); return(1); } else if (count == 2 && ToLua.CheckTypes(L, 1, typeof(string), typeof(byte[]))) { string arg0 = ToLua.CheckString(L, 1); byte[] arg1 = ToLua.CheckByteBuffer(L, 2); UnityEngine.WWW obj = new UnityEngine.WWW(arg0, arg1); ToLua.PushObject(L, obj); return(1); } else if (count == 2 && ToLua.CheckTypes(L, 1, typeof(string), typeof(UnityEngine.WWWForm))) { string arg0 = ToLua.CheckString(L, 1); UnityEngine.WWWForm arg1 = (UnityEngine.WWWForm)ToLua.CheckObject(L, 2, typeof(UnityEngine.WWWForm)); UnityEngine.WWW obj = new UnityEngine.WWW(arg0, arg1); ToLua.PushObject(L, obj); return(1); } else if (count == 3 && ToLua.CheckTypes(L, 1, typeof(string), typeof(byte[]), typeof(System.Collections.Generic.Dictionary <string, string>))) { string arg0 = ToLua.CheckString(L, 1); byte[] arg1 = ToLua.CheckByteBuffer(L, 2); System.Collections.Generic.Dictionary <string, string> arg2 = (System.Collections.Generic.Dictionary <string, string>)ToLua.CheckObject(L, 3, typeof(System.Collections.Generic.Dictionary <string, string>)); UnityEngine.WWW obj = new UnityEngine.WWW(arg0, arg1, arg2); ToLua.PushObject(L, obj); return(1); } else { LuaDLL.luaL_error(L, "invalid arguments to method: UnityEngine.WWW.New"); } return(0); }
static public int GetAudioClipCompressed(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); if (argc == 1) { UnityEngine.WWW self = (UnityEngine.WWW)checkSelf(l); var ret = self.GetAudioClipCompressed(); pushValue(l, true); pushValue(l, ret); return(2); } else if (argc == 2) { UnityEngine.WWW self = (UnityEngine.WWW)checkSelf(l); System.Boolean a1; checkType(l, 2, out a1); var ret = self.GetAudioClipCompressed(a1); pushValue(l, true); pushValue(l, ret); return(2); } else if (argc == 3) { UnityEngine.WWW self = (UnityEngine.WWW)checkSelf(l); System.Boolean a1; checkType(l, 2, out a1); UnityEngine.AudioType a2; checkEnum(l, 3, out a2); var ret = self.GetAudioClipCompressed(a1, a2); pushValue(l, true); pushValue(l, ret); return(2); } pushValue(l, false); LuaDLL.lua_pushstring(l, "No matched override function to call"); return(2); } catch (Exception e) { return(error(l, e)); } }
static int get_url(IntPtr L) { #if UNITY_EDITOR ToluaProfiler.AddCallRecord("UnityEngine.WWW.url"); #endif object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; string ret = obj.url; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index url on a nil value")); } }
static int get_keepWaiting(IntPtr L) { #if UNITY_EDITOR ToluaProfiler.AddCallRecord("UnityEngine.WWW.keepWaiting"); #endif object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; bool ret = obj.keepWaiting; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index keepWaiting on a nil value")); } }
static int set_threadPriority(IntPtr L) { #if UNITY_EDITOR ToluaProfiler.AddCallRecord("UnityEngine.WWW.threadPriority"); #endif object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.WWW obj = (UnityEngine.WWW)o; UnityEngine.ThreadPriority arg0 = (UnityEngine.ThreadPriority)ToLua.CheckObject(L, 2, typeof(UnityEngine.ThreadPriority)); obj.threadPriority = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index threadPriority on a nil value")); } }
static int _m_Dispose(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.WWW __cl_gen_to_be_invoked = (UnityEngine.WWW)translator.FastGetCSObj(L, 1); try { { __cl_gen_to_be_invoked.Dispose( ); return(0); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }