Пример #1
0
    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;
        }
    }
Пример #2
0
 public void DoComment()
 {
     if (OCBridge.IsCommentAvailable())
     {
         PlayerPrefs.SetInt(PlayerPrefsKey.Comment, 1);
         OCBridge.JumpToComment();
     }
 }
Пример #3
0
 public void Login()
 {
     if (!OCBridge.IsGameCenterAvailable())
     {
         return;
     }
     Social.localUser.Authenticate(HandleAuthenticated);
 }
Пример #4
0
    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);
    }
Пример #5
0
    public void ShowCommentConfirm()
    {
        int comment = PlayerPrefs.GetInt(PlayerPrefsKey.Comment, 0);

        if (OCBridge.IsCommentAvailable() && currentPlayedLevel >= 5 && comment < 1)
        {
            this.ShowConfirm("", "LKCommentContent", "OnCommentConfirm");
            currentPlayedLevel = 0;
        }
    }
Пример #6
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);
     }
 }
Пример #7
0
 public void UpdateScore(int score)
 {
     if (!OCBridge.IsGameCenterAvailable())
     {
         return;
     }
     if (Social.localUser.authenticated)
     {
         Social.ReportScore(score, GameCenterKey.LadderId, HandleScoreReported);
     }
 }
Пример #8
0
 public void ShowGameCenter()
 {
     if (!OCBridge.IsGameCenterAvailable())
     {
         return;
     }
     if (isGameCenterSuccess && Social.localUser.authenticated)
     {
         Social.ShowAchievementsUI();
     }
 }
Пример #9
0
    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();
        }
    }
Пример #10
0
 public void Purchase(string productId)
 {
     OCBridge.PurchaseProduct(productId);
 }
Пример #11
0
 public void GetProductInfo(string productId)
 {
     OCBridge.RequestProductInfoById(productId);
 }
Пример #12
0
 public void IsAvailable()
 {
     OCBridge.IsIAPAvailable();
 }
Пример #13
0
 public void Init()
 {
     OCBridge.InitIAP();
     this.GetProductInfo(DefinePurchaseId.PurchaseId10 + "\t" + DefinePurchaseId.PurchaseId40 + "\t" +
                         DefinePurchaseId.PurchaseId160 + "\t" + DefinePurchaseId.PurchaseIdSale12);
 }
Пример #14
0
 public bool IsGameCenterOK()
 {
     return(_socialMgr.isGameCenterSuccess && OCBridge.IsGameCenterAvailable());
 }
Пример #15
0
 void Awake()
 {
     NotificationServices.RegisterForNotifications(NotificationType.Alert | NotificationType.Badge | NotificationType.Sound);
     OCBridge.ClearLocalNotification();
 }