public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) { preference = Asset.Load <DeployGatePreference> (); if (target == BuildTarget.Android && pathToBuiltProject.Contains(preference.temp.directryPath)) { AndroidPostprocessBuild(pathToBuiltProject); } }
public static MembersInfo AddMember(int role, string name) { DeployGatePreference preference = Asset.Load <DeployGatePreference>(); string url = string.Format(INVITE_API, preference.user.username, PlayerSettings.bundleIdentifier); var bytes = GetForm(preference, role, name).data; WWW www = new WWW(url, bytes); while (!www.isDone) { Thread.Sleep(1); } return(GetMembers()); }
public static MembersInfo DeleteMember(Member member) { DeployGatePreference preference = Asset.Load <DeployGatePreference>(); string url = string.Format(INVITE_API, preference.user.username, PlayerSettings.bundleIdentifier); #if UNITY_EDITOR_OSX Process process = new Process(); process.StartInfo.FileName = "curl"; process.StartInfo.Arguments = string.Format("-X DELETE -F \"users=[{0}]\" -F \"token={1}\" {2}", member.name, preference.user.token, url); process.Start(); process.WaitForExit(); #elif Debug.LogException(new NotImplementedException()); #endif return(GetMembers()); }
public static MembersInfo GetMembers() { if (req != null) { return(null); } DeployGatePreference preference = Asset.Load <DeployGatePreference>(); string url = string.Format(INVITE_API, preference.user.username, PlayerSettings.bundleIdentifier) + "?token=" + preference.user.token; req = new WWW(url); while (!req.isDone) { Thread.Sleep(1); } string text = req.text; req = null; return(MiniJSON.Json.Deserialize <MembersInfo>(text)); }
public static void Push(string pathToBuiltProject) { DeployGatePreference preference = Asset.Load <DeployGatePreference>(); EditorUtility.DisplayProgressBar("Upload to DeployGate", "", 0); { WWWForm form = GetForm(preference, pathToBuiltProject); WWW www = new WWW(string.Format(PUSH_URL, preference.user.username), form); while (!www.isDone) { EditorUtility.DisplayProgressBar("Upload to DeployGate", string.Format("Uploading... {0}%", Mathf.FloorToInt(www.uploadProgress * 100)), www.uploadProgress); System.Threading.Thread.Sleep(1); } } EditorUtility.ClearProgressBar(); SaveMessage(pathToBuiltProject); }
private static void AndroidPostprocessBuild(string pathToBuiltProject) { EditorApplication.LockReloadAssemblies(); PlayerSettings.Android.forceInternetPermission = preference.forceInternetPermission; if (pathToBuiltProject.LastIndexOf(".apk") != -1) { DeployGateAPI.Push(pathToBuiltProject); //Delete Temp Directory.Delete(preference.temp.directryPath, true); DeployGateUtility.MoveDeployGateSDK(DeployGateUtility.PLUGINS_PATH, DeployGateUtility.DEPLOYGATE_PLUGINS_PATH); Asset.Load <DeployGatePreference> ().temp.messagePath = ""; } else { // Android Project } EditorApplication.UnlockReloadAssemblies(); }
void OnEnable() { preference = Asset.Load <DeployGatePreference>(); DeployGateBuildWindow.Reset(); EditorUtility.UnloadUnusedAssets(); }