/// Provide static access to setup for facilitating automated builds. /// <param name="nearbyServiceId">The nearby connections service Id</param> /// <param name="androidBuild">true if building android</param> public static bool PerformSetup(string nearbyServiceId, bool androidBuild) { // check for valid app id if (!GPGSUtil.LooksLikeValidServiceId(nearbyServiceId)) { GPGSUtil.Alert(GPGSStrings.Setup.ServiceIdError); return(false); } GPGSProjectSettings.Instance.Set(GPGSUtil.SERVICEIDKEY, nearbyServiceId); GPGSProjectSettings.Instance.Save(); if (androidBuild) { // create needed directories GPGSUtil.EnsureDirExists(GPGSUtil.modifiedDir + "/Plugins"); GPGSUtil.EnsureDirExists(GPGSUtil.modifiedDir + "/Plugins/Android"); // Generate AndroidManifest.xml GPGSUtil.GenerateAndroidManifest(); // refresh assets, and we're done AssetDatabase.Refresh(); GPGSProjectSettings.Instance.Set(GPGSUtil.NEARBYSETUPDONEKEY, true); GPGSProjectSettings.Instance.Save(); } return(true); }
/// Provide static access to setup for facilitating automated builds. /// <param name="nearbyServiceId">The nearby connections service Id</param> /// <param name="androidBuild">true if building android</param> public static bool PerformSetup(string nearbyServiceId, bool androidBuild) { // check for valid app id if (!GPGSUtil.LooksLikeValidServiceId(nearbyServiceId)) { if (EditorUtility.DisplayDialog( "Remove Nearby connection permissions? ", "The service Id is invalid. It must follow package naming rules. " + "Do you want to remove the AndroidManifest entries for Nearby connections?", "Yes", "No")) { GPGSProjectSettings.Instance.Set(GPGSUtil.SERVICEIDKEY, null); GPGSProjectSettings.Instance.Save(); } else { return(false); } } else { GPGSProjectSettings.Instance.Set(GPGSUtil.SERVICEIDKEY, nearbyServiceId); GPGSProjectSettings.Instance.Save(); } if (androidBuild) { // create needed directories GPGSUtil.EnsureDirExists("Assets/Plugins"); GPGSUtil.EnsureDirExists("Assets/Plugins/Android"); // Generate AndroidManifest.xml GPGSUtil.GenerateAndroidManifest(); GPGSProjectSettings.Instance.Set(GPGSUtil.NEARBYSETUPDONEKEY, true); GPGSProjectSettings.Instance.Save(); // Resolve the dependencies Google.VersionHandler.VerboseLoggingEnabled = true; Google.VersionHandler.UpdateVersionedAssets(forceUpdate: true); Google.VersionHandler.Enabled = true; AssetDatabase.Refresh(); Google.VersionHandler.InvokeStaticMethod( Google.VersionHandler.FindClass( "Google.JarResolver", "GooglePlayServices.PlayServicesResolver"), "MenuResolve", null); } return(true); }
/// Provide static access to setup for facilitating automated builds. /// <param name="nearbyServiceId">The nearby connections service Id</param> /// <param name="androidBuild">true if building android</param> public static bool PerformSetup(string nearbyServiceId, bool androidBuild) { // check for valid app id if (!GPGSUtil.LooksLikeValidServiceId(nearbyServiceId)) { GPGSUtil.Alert(GPGSStrings.Setup.ServiceIdError); return(false); } GPGSProjectSettings.Instance.Set(GPGSUtil.SERVICEIDKEY, nearbyServiceId); GPGSProjectSettings.Instance.Save(); if (androidBuild) { // create needed directories GPGSUtil.EnsureDirExists("Assets/Plugins"); GPGSUtil.EnsureDirExists("Assets/Plugins/Android"); // Generate AndroidManifest.xml GPGSUtil.GenerateAndroidManifest(); GPGSProjectSettings.Instance.Set(GPGSUtil.NEARBYSETUPDONEKEY, true); GPGSProjectSettings.Instance.Save(); // Resolve the dependencies Google.VersionHandler.VerboseLoggingEnabled = true; Google.VersionHandler.UpdateVersionedAssets(forceUpdate: true); Google.VersionHandler.Enabled = true; AssetDatabase.Refresh(); GPGSDependencies.RegisterDependencies(); Google.VersionHandler.InvokeStaticMethod( Google.VersionHandler.FindClass( "Google.JarResolver", "GooglePlayServices.PlayServicesResolver"), "MenuResolve", null); } return(true); }