public void ShowMessage(string title, string message, string[] buttons) { if (string.IsNullOrEmpty(title)) { //title = APPNAME; } if (null == buttons || buttons.Length <= 0) { buttons = new[] { "Close" }; } #if UNITY_ANDROID && ETCETERA && !UNITY_EDITOR if (buttons.Length == 1) { EtceteraB.showAlert(title, message, buttons[0]); } else if (buttons.Length >= 2) { EtceteraB.showAlert(title, message, buttons[0], buttons[1]); } #elif UNITY_IOS && ETCETERA && !UNITY_EDITOR EtceteraB.showAlertWithTitleMessageAndButtons(title, message, buttons); #elif UNITY_EDITOR #endif MyDebug.Log(title + "\n\n" + message); }
public void HideProgressDialog() { #if ETCETERA #if UNITY_IOS EtceteraB.hideActivityView(); #endif #if UNITY_ANDROID //EtceteraB.hideProgressDialog(); #endif #endif }
public void ShowProgressDialog(string title = "", string message = "") { #if ETCETERA #if UNITY_IOS EtceteraB.showActivityView(); #endif #if UNITY_ANDROID //EtceteraB.showProgressDialog(title, message); #endif #endif }
public void SetAndroidAleartTheme() { #if UNITY_ANDROID && ETCETERA //THEME_DEVICE_DEFAULT_LIGHT =5 //THEME_DEVICE_DEFAULT_DARK = 4 //THEME_HOLO_LIGHT= 3 //THEME_HOLO_DARK = 2 //THEME_TRADITIONAL = 1 EtceteraB.setAlertDialogTheme(5); #endif }
public void UpdateVersion() { settings.isAlreadyRated = false; settings.isNeverAskForReview = false; #if UNITY_ANDROID #if ETCETERA EtceteraB.resetAskForReview(); #endif #endif SaveSettings(); }
void Start() { #if UNITY_ANDROID Invoke("GetGCMToken", 5f); #endif #if UNITY_IOS #if ETCETERA EtceteraB.setBadgeCount(0); #endif this.CheckPushON(); #endif }
void RemotePushReceived(JsonObject obj) { #if UNITY_IOS #if ETCETERA EtceteraB.setBadgeCount(0); #endif UnityEngine.iOS.NotificationServices.ClearRemoteNotifications(); #endif //if (!Application.loadedLevelName.Equals ("MainMenu")) { if (SceneManager.GetActiveScene().name.StartsWith("MainMenu", System.StringComparison.OrdinalIgnoreCase)) { return; } MyDebug.Log("Push notification recevied, checking data"); if (obj != null) { //MyDebug.Log(Json.Serialize(obj)); if (obj.ContainsKey("action")) { JsonObject action = (JsonObject)obj["action"]; if (action.ContainsKey("type") && action.ContainsKey("method")) { string notiMethod = action["method"].ToString().ToLower(); switch (notiMethod) { case "challenge": case "response": break; } } else { MyDebug.Log("Push Notification has wrong data"); } } else { MyDebug.Log("Push Notification has not action information"); } } else { MyDebug.Log("Push Notification doesn't have any data"); } }
public void AskForReview(ButtonEventArgs args) { if (CoreUtility.Me.settings.isAlreadyRated || CoreUtility.Me.settings.isNeverAskForReview) { return; } #if UNITY_IOS && ETCETERA alert = AlertType.Review; EtceteraB.askForReview(REVIEW_TITLE, REVIEW_TEXT, APPITUNESID); #elif UNITY_ANDROID && ETCETERA EtceteraB.askForReviewSetButtonTitles("Next time", "Don't ask me again", "Sure!"); #if !AMAZONSTORE EtceteraB.askForReviewNow(REVIEW_TITLE, REVIEW_TEXT, false); #endif #if AMAZONSTORE EtceteraB.askForReviewNow(REVIEW_TITLE, REVIEW_TEXT, true); #endif #endif }
public void ShareHighscore(ButtonEventArgs args) { if (!CoreUtility.Me.ShowInternetConnection()) { return; } MyDebug.Log("GameUtility::ShareHighscore => Share to: " + args.data); CoreUtility.Me.shareMode = ShareMode.Highscore; string shareText = GetRandomHighScoreShareMessage(); int score = GetBestScore(); string hScoreShareText = string.Format(shareText, score); MyDebug.Log(args.data + ": Share is => " + hScoreShareText); #if UNITY_EDITOR GameAnax.Core.Utility.Popup.PopupMessages.Me.NativeFuncionNonAvailableMessage(); return; #endif if (args.data.Equals("Facebook", StringComparison.OrdinalIgnoreCase)) { #if SOCIALNETWORKING FBService.Me.ShareTextOnFB(hScoreShareText, STORE_LONG_URL); #endif } else if (args.data.Equals("Native", StringComparison.OrdinalIgnoreCase)) { #if UNITY_IOS && SOCIALNETWORKING Prime31.SharingBinding.shareItems(new[] { hScoreShareText, STORE_SHORT_URL }, _excludeActivity); #endif #if UNITY_ANDROID && ETCETERA EtceteraB.shareWithNativeShareIntent(hScoreShareText + "\n" + STORE_SHORT_URL, "", "Share On", null); #endif } else if (args.data.Equals("Twitter", StringComparison.OrdinalIgnoreCase)) { #if SOCIALNETWORKING FBService.Me.ShareOnTwitter(hScoreShareText, STORE_SHORT_URL); #endif } }