static bool IsActiveAD() { string appVersion = "1.0.0"; #if UNITY_IPHONE appVersion = iOSInterfaces.getAPPVersion(); #elif UNITY_ANDROID appVersion = AndroidInterfaces.CallGetAppVersion(); #endif #if UNITY_IPHONE || UNITY_ANDROID string currentVersionADActiveKey = "ad_switch_" + appVersion; GA.UpdateOnlineConfig(); string ADActiveState = GA.GetConfigParamForKey(currentVersionADActiveKey); #else string ADActiveState = "0"; #endif bool available = true; //(Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android) //&& (string.IsNullOrEmpty(ADActiveState) || ADActiveState == "1"); Debug.Log(string.Format("AD state is {0}! version:{1} online param:{2}", available?"on":"off", appVersion, ADActiveState)); return(available); }
//private private string GetAPPVersion() { string appVersion = "1.0.0"; #if UNITY_IPHONE appVersion = iOSInterfaces.getAPPVersion(); #elif UNITY_ANDROID appVersion = AndroidInterfaces.CallGetAppVersion(); #endif return(appVersion); }
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(); }