private void InitLocalization() { SystemLanguage localLanguage = OCBridge.GetSystemLanguage(); string savedLanguage = PlayerPrefs.GetString(PlayerPrefsKey.Language, "notset"); if (savedLanguage == "notset") { // 没有设置过, 则尝试使用系统语言 if (localLanguage == SystemLanguage.Chinese) { Localization.language = "SChinese"; } else if (localLanguage == SystemLanguage.ChineseSimplified) { Localization.language = "SChinese"; } else if (localLanguage == SystemLanguage.ChineseTraditional) { Localization.language = "TChinese"; } else if (localLanguage == SystemLanguage.Japanese) { Localization.language = "Japanese"; } else { Localization.language = "English"; } } else { Localization.language = savedLanguage; } }
public void DoComment() { if (OCBridge.IsCommentAvailable()) { PlayerPrefs.SetInt(PlayerPrefsKey.Comment, 1); OCBridge.JumpToComment(); } }
public void Login() { if (!OCBridge.IsGameCenterAvailable()) { return; } Social.localUser.Authenticate(HandleAuthenticated); }
void OnApplicationQuit() { string title = LocalizeMgr.Instance.GetLocalizeStr(LocalizeStringKey.NotificationTitle); string message = LocalizeMgr.Instance.GetLocalizeStr(LocalizeStringKey.NotificationMessage); OCBridge.LocalRepeatWeekNotificationMessage(title, message); //OCBridge.LocalIntervalNotificationMessage(title, message, 10); }
public void ShowCommentConfirm() { int comment = PlayerPrefs.GetInt(PlayerPrefsKey.Comment, 0); if (OCBridge.IsCommentAvailable() && currentPlayedLevel >= 5 && comment < 1) { this.ShowConfirm("", "LKCommentContent", "OnCommentConfirm"); currentPlayedLevel = 0; } }
public void UpdateReportProgress(string achieveId, int score, int totalScore) { if (!OCBridge.IsGameCenterAvailable()) { return; } if (Social.localUser.authenticated) { Social.ReportProgress(achieveId, (double)score / (double)totalScore * 100, HandleProgressReported); } }
public void UpdateScore(int score) { if (!OCBridge.IsGameCenterAvailable()) { return; } if (Social.localUser.authenticated) { Social.ReportScore(score, GameCenterKey.LadderId, HandleScoreReported); } }
public void ShowGameCenter() { if (!OCBridge.IsGameCenterAvailable()) { return; } if (isGameCenterSuccess && Social.localUser.authenticated) { Social.ShowAchievementsUI(); } }
void OnApplicationPause(bool paused) { string title = LocalizeMgr.Instance.GetLocalizeStr(LocalizeStringKey.NotificationTitle); string message = LocalizeMgr.Instance.GetLocalizeStr(LocalizeStringKey.NotificationMessage); if (paused) { OCBridge.LocalRepeatWeekNotificationMessage(title, message); //OCBridge.LocalIntervalNotificationMessage(title, message, 10); } else { OCBridge.ClearLocalNotification(); } }
public void Purchase(string productId) { OCBridge.PurchaseProduct(productId); }
public void GetProductInfo(string productId) { OCBridge.RequestProductInfoById(productId); }
public void IsAvailable() { OCBridge.IsIAPAvailable(); }
public void Init() { OCBridge.InitIAP(); this.GetProductInfo(DefinePurchaseId.PurchaseId10 + "\t" + DefinePurchaseId.PurchaseId40 + "\t" + DefinePurchaseId.PurchaseId160 + "\t" + DefinePurchaseId.PurchaseIdSale12); }
public bool IsGameCenterOK() { return(_socialMgr.isGameCenterSuccess && OCBridge.IsGameCenterAvailable()); }
void Awake() { NotificationServices.RegisterForNotifications(NotificationType.Alert | NotificationType.Badge | NotificationType.Sound); OCBridge.ClearLocalNotification(); }