Example #1
0
 public void SNSButtonOnClick()
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android)
     {
         if (KTPlay.IsEnabled())
         {
             KTPlay.Show();
         }
     }
     GameSoundSystem.GetInstance().PlayRandomSound();
 }
Example #2
0
 public void LoginButtonOnClick()
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android)
     {
         if (KTPlay.IsEnabled())
         {
             KTAccountManager.ShowLoginView(true, this, OnKTPlayLoginFinish);
         }
     }
     GameSoundSystem.GetInstance().PlayRandomSound();
 }
Example #3
0
    public bool IsSNSAvailable()
    {
        string appVersion = GetAPPVersion();

                #if UNITY_IPHONE || UNITY_ANDROID
        string currentVersionSNSActiveKey = "sns_switch_" + appVersion;

        string SNSActiveState = GA.GetConfigParamForKey(currentVersionSNSActiveKey);
                #else
        string SNSActiveState = "0";
                #endif
        bool available = (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android) &&
                         (string.IsNullOrEmpty(SNSActiveState) || SNSActiveState == "1") &&
                         LocalVersion.local == LocalVersion.Local.CN_ZH &&
                         KTPlay.IsEnabled();
        Debug.Log(string.Format("SNS state is {0}! version:{1} online param:{2}", available?"on":"off", appVersion, SNSActiveState));
        return(available);
    }
Example #4
0
    public void RefreshRankButton()
    {
        bool needShowRankButton = (LocalVersion.local == LocalVersion.Local.CN_ZH);

        if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android)
        {
            needShowRankButton = needShowRankButton && KTPlay.IsEnabled();
        }

        int index = 0;

        foreach (GameObject rankButton in rankButtons)
        {
            if (mode == GameSystem.Mode.Dual)
            {
                rankButton.SetActive(false);
            }
            else
            {
                if ((mode == GameSystem.Mode.BlackJack || mode == GameSystem.Mode.Word) && index != 0)
                {
                    rankButton.SetActive(false);
                }
                else
                {
                    rankButton.SetActive(needShowRankButton);
                }
            }
            index++;
        }

        if (LocalVersion.local == LocalVersion.Local.EN)
        {
            for (int i = 0; i < rankButtons.Length; i++)
            {
                Vector3 rankButtonPos      = rankButtons[i].transform.localPosition;
                Vector3 bestRecordLabelPos = bestRecordLabels[i].transform.localPosition;
                bestRecordLabelPos.y = rankButtonPos.y;
                bestRecordLabels[i].transform.localPosition = bestRecordLabelPos;
            }
        }
    }
Example #5
0
    void Start()
    {
        coinLabel.text = string.Format("{0}", GameSystem.GetInstance().Coin);
        GameSystem.GetInstance().OnCoinChanged += HandleOnCoinChanged;
        muteButton.value = PlayerProfile.LoadMute();
        EventDelegate.Add(muteButton.onChange, MuteButtonValueOnChange);
        GameSoundSystem.GetInstance().Mute = muteButton.value;
        shopButton.SetActive(Config.isStoreActive);
        moreGameLabel.text = Config.isMoreGameActive ? TextManager.GetText("more_game") : "...";
        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            versionLabel.text = "v" + iOSInterfaces.getAPPVersion();

            foreach (GameObject modeObject in modeObjects)
            {
                if (modeObject.GetComponent <MoreModeButton>() != null)
                {
                    modeObjects.Remove(modeObject);
                    modeObject.SetActive(false);
                    break;
                }
            }
        }
        else if (Application.platform == RuntimePlatform.Android)
        {
            versionLabel.text = "v" + AndroidInterfaces.CallGetAppVersion();
        }

#if UNITY_IPHONE || UNITY_ANDROID
        if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
        {
            KTPlay.SetAvailabilityChangedCallback(this, KTPlayAvailabilityChanged);
            GA.UpdateOnlineConfig();
        }
#endif
        UpdateGiftButtonState();
        RefreshVIPButtonState();
    }