public static void OnBuildEnd(BuildTarget target, string pathToBuiltProject) { if (!target.Equals(BuildTarget.PSP2)) { return; } if (pathToBuiltProject.Contains("/data/VitaUnity/build")) { CustomPrepBuild(true, pathToBuiltProject); sendCommand("usb disable -"); sendCommand("file ux0:data/VitaUnity/build/build.self"); return; } File.WriteAllText(LastBuildDirSavePath, pathToBuiltProject); if (data == null) { data = JsonUtility.FromJson <UploadWrapper.UploadData>(File.ReadAllText(VitaFTPOptions.SavePath)); } if (!data.startOnBuildEnd) { return; } UnityEngine.Debug.Log("Autorunning"); if (loadData() < 0) { return; } BuildVPK(true); ReplaceInstall(); }
static int loadData() { if (data == null && File.Exists(VitaFTPOptions.SavePath)) { data = JsonUtility.FromJson <UploadWrapper.UploadData>(File.ReadAllText(VitaFTPOptions.SavePath)); } else if (!File.Exists(VitaFTPOptions.SavePath)) { UnityEngine.Debug.Log("Please configure options under VitaFTPI/Options"); File.WriteAllText(VitaFTPOptions.SavePath, JsonUtility.ToJson(new UploadBuild())); return(-1); } if (UploaderPath == null) { if (!data.CustomUploaderFolder) { UploaderPath = Regex.Replace(Application.dataPath, "Assets", "Uploader"); } else { UploaderPath = data.UploaderFolder; } } return(0); }
static void GetUploadData() { if (!File.Exists(SavePath)) { File.WriteAllText(SavePath, JsonUtility.ToJson(new UploadWrapper.UploadData())); } uploadData = JsonUtility.FromJson <UploadWrapper.UploadData>(File.ReadAllText(SavePath)); }
static int PreSetup() { if (data == null && File.Exists(VitaFTPOptions.SavePath)) { data = JsonUtility.FromJson <UploadWrapper.UploadData>(File.ReadAllText(VitaFTPOptions.SavePath)); } else if (!File.Exists(VitaFTPOptions.SavePath)) { UnityEngine.Debug.Log("Please configure options under VitaFTPI/Options"); File.WriteAllText(VitaFTPOptions.SavePath, JsonUtility.ToJson(new UploadBuild())); return(-1); } buildDir = File.ReadAllText(LastBuildDirSavePath); if (!Directory.Exists(buildDir)) { UnityEngine.Debug.LogError("No build found!"); return(-2); } if (UploaderPath == null) { if (!data.CustomUploaderFolder) { UploaderPath = Regex.Replace(Application.dataPath, "Assets", "Uploader"); } else { UploaderPath = data.UploaderFolder; } } if (Directory.Exists("\"" + UploaderPath + "\"")) { } if (Directory.Exists(UploaderPath)) { } else { UnityEngine.Debug.Log("Uploader folder not found exiting!"); UnityEngine.Debug.Log(UploaderPath); return(-1); } return(0); }