コード例 #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();
 }