public void EditorImportConfig() { if (this.gameYcId != "") { string url = RequestManager.GetUrlEmptyStatic("games/setting/" + this.gameYcId + "/" + Application.identifier, true); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); request.Method = "Get"; request.ContentType = "application/json"; try { using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { using (var reader = new StreamReader(response.GetResponseStream())) { InfosData infos = Newtonsoft.Json.JsonConvert.DeserializeObject <DataData>(reader.ReadToEnd()).data; if (infos.name != "") { this.Name = infos.name; this.FbAppId = infos.facebook_app_id; this.appleId = infos.ios_key; this.AdMobAndroidAppId = infos.admob_android_app_id; this.AdMobIosAppId = infos.admob_ios_app_id; this.IosInterstitial = infos.applovin.adunits.ios.interstitial; this.IosRewarded = infos.applovin.adunits.ios.rewarded; this.IosBanner = infos.applovin.adunits.ios.banner; this.AndroidInterstitial = infos.applovin.adunits.android.interstitial; this.AndroidRewarded = infos.applovin.adunits.android.rewarded; this.AndroidBanner = infos.applovin.adunits.android.banner; // MMPs this.MmpAdjust = infos.mmps.adjust.active; this.MmpAdjustAppToken = infos.mmps.adjust.active ? infos.mmps.adjust.app_token : ""; this.MmpTenjin = infos.mmps.tenjin.active; this.InitFacebook(); this.InitMax(); this.InitFirebase(infos); } else { this.DisplayDialog("Error", "Impossible to import config. Check your Game Yc Id or your connection.", "Ok"); } } } } catch (Exception e) { this.DisplayDialog("Error", "Impossible to import config. Check your Game Yc Id or your connection.", "Ok"); } } else { this.DisplayDialog("Error", "Please enter Game Yc Id", "Ok"); } }
public void InitFirebase(InfosData infos) { #if FIREBASE if (infos.google_services_android != "") { this.CreateOrUpdateFileInAssets("GameUtils/google-services.json", infos.google_services_android); } if (infos.google_services_ios != "") { this.CreateOrUpdateFileInAssets("GameUtils/GoogleService-Info.plist", infos.google_services_ios); } #if UNITY_EDITOR AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate); #endif #endif }
public void EditorImportConfig() { if (this.gameYcId != "") { string url = RequestManager.GetUrlEmptyStatic("games/setting/" + this.gameYcId + "/" + Application.identifier, true); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); request.Method = "Get"; request.ContentType = "application/json"; try { using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { using (var reader = new System.IO.StreamReader(response.GetResponseStream())) { InfosData infos = Newtonsoft.Json.JsonConvert.DeserializeObject <DataData>(reader.ReadToEnd()).data; if (infos.name != "") { this.Name = infos.name; this.FbAppId = infos.facebook_app_id; this.MmpAdjust = infos.mmps.adjust.active; this.MmpAdjustAppToken = infos.mmps.adjust.active ? infos.mmps.adjust.app_token : ""; this.MmpTenjin = infos.mmps.tenjin.active; } else { this.DisplayDialog("Error", "Impossible to import config. Check your Game Yc Id or your connection.", "Ok"); } this.InitFacebook(); } } } catch (Exception e) { this.DisplayDialog("Error", "Impossible to import config. Check your Game Yc Id or your connection.", "Ok"); } } else { this.DisplayDialog("Error", "Please enter Game Yc Id", "Ok"); } }