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(); }
static string GetFilePath() { return(GetFileFolder() + PythonManager.GetPythonFileName()); }