/** * - * * - * @Title: preloadAds * - * @Description: preload ad with the type and idx * - * @param @param adsType the type of ad * - * @param @param idx * - * @return void * - */ public void preloadAds(AdsType adsType, int idx = 1) { #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS) GameAds_nativePreloadAds(adsType, idx); #else Debug.Log("This platform does not support!"); #endif }
public static void HideAll(AdsType type) { if (showAds) { plugin.HideAll(type); } Print($"{type} All Ads Hided"); }
/** * * @Title: hideAds * @Description: hide ad with the type and idx * @param @param adsType the type of ad * @param @param idx * @return void */ public void hideAds(AdsType adsType, int idx = 1) { #if UNITY_ANDROID || UNITY_IOS AnySDKAds_nativeHideAds(adsType, idx); #else Debug.Log("This platform does not support!"); #endif }
/** * * @Title: showAds * @Description: show ad with the type and idx * @param @param adsType the type of ad * @param @param idx * @return void */ public void showAds(AdsType adsType, int idx = 1) { #if !UNITY_EDITOR && ( UNITY_ANDROID ) AnySDKAds_nativeShowAds(adsType, idx); #else Debug.Log("This platform does not support!"); #endif }
/** * * @Title: isAdTypeSupported * @Description: does the plugin support the type of ad * @param @param adsType * @param @return * @return boolean */ public bool isAdTypeSupported(AdsType adType) { #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS) return(GameAds_nativeIsAdTypeSupported(adType)); #else Debug.Log("This platform does not support!"); return(false); #endif }
public static void HandleRewarded_Video(ShopProductEntry shopProductEntry, ShopProductData shopProductData, AdsType adsType) { SushiDebug.Log("The ad was successfully shown. (Video)"); SushiDebug.LogFormat("HandleShowResult: shopProductEntry: {0}", shopProductEntry); SushiDebug.LogFormat("HandleShowResult: shopProductData: {0}", shopProductData); // 이번 스테이지를 처음부터 새로 시작한다. LoadStageFromStart(stageNumber); }
/** * * @Title: isAdTypeSupported * @Description: does the plugin support the type of ad * @param @param adsType * @param @return * @return boolean */ public bool isAdTypeSupported(AdsType adType) { #if UNITY_ANDROID || UNITY_IOS return(AnySDKAds_nativeIsAdTypeSupported(adType)); #else Debug.Log("This platform does not support!"); return(false); #endif }
public static IAdsService Get(AdsType type) { if (adServices.ContainsKey(type)) { return(adServices[type]); } return(null); }
public static void HandleRewarded_RewardedVideo(ShopProductEntry shopProductEntry, ShopProductData shopProductData, AdsType adsType) { SushiDebug.Log("The ad was successfully shown. (Rewarded Video)"); SushiDebug.LogFormat("HandleShowResult: shopProductEntry: {0}", shopProductEntry); SushiDebug.LogFormat("HandleShowResult: shopProductData: {0}", shopProductData); // 체크포인트부터 이어서 플레이한다. // HotairBalloon.initialPositionY를 리셋하지 않으면 // 이어서 되도록 해 놓았다. Bootstrap.ReloadCurrentScene(); }
public bool IsAdEnabled(AdsType type) { switch(type) { case AdsType.Banner: case AdsType.Interstitial: return (!IsAdsRemoved() || _UseInterstitialForRewardAd) && SupportAdsType[(int)type]; case AdsType.RewardedVideo: return SupportAdsType[(int)type]; case AdsType.OfferWall: return SupportAdsType[(int)type]; } return false; }
//--------------------------------------------------------------------------------------------------------------- public void Show(Action callbackWatched, Action callbackNotWatched, AdsType type = DefaultPlacementID) { onAdsWatchedCallback = callbackWatched; onAdsNotWatchedCallback = callbackNotWatched; if (!IsAvailable(type)) { return; } AdsDummy.Show(type.GetDesc(), new AdsDummy.ShowOptions() { resultCallback = OnAdsWatched }); }
public void FetechBannerAds(AdsType type, AdSize size) { if (adsType == AdsType.BannerBottom) { position = AdPosition.Bottom; } else if (adsType == AdsType.BannerTop) { position = AdPosition.Top; } else { position = AdPosition.Bottom; } if (size == AdSize.Banner) { adSize = AdSize.Banner; } else if (size == AdSize.SmartBanner) { adSize = AdSize.SmartBanner; } else { adSize = AdSize.Banner; } bannerAds = new BannerView(AdsConfig.AdsAdmobBannerPlacement, size, position); if (bannerAds != null) { AdRequest request = new AdRequest.Builder().AddTestDevice("063215AC51C16009CE71243D30B7C2A1").Build(); bannerAds.LoadAd(request); bannerAds.AdLoaded += BannerAds_AdLoaded; bannerAds.AdFailedToLoad += BannerAds_AdFailedToLoad; bannerAds.AdOpened += BannerAds_AdOpened; bannerAds.AdClosing += BannerAds_AdClosing; bannerAds.AdClosed += BannerAds_AdClosed; bannerAds.AdLeftApplication += BannerAds_AdLeftApplication; } else { Debug.LogError("AdsManger: Banner Ads isn't, please init it"); } }
public void ShowAds(AdsType _adsType) { switch (_adsType) { case AdsType.Interstitial: ads.ShowInterstitialAd(); break; case AdsType.Rewarded: ads.ShowRewadedAd(); break; default: break; } }
private unsafe void SetValue(object managedValue, AdsType adsType) { adsvalue = new AdsValue(); adsvalue.dwType = (int)adsType; switch (adsType) { case AdsType.ADSTYPE_INTEGER: adsvalue.generic.a = (int)managedValue; adsvalue.generic.b = 0; break; case AdsType.ADSTYPE_LARGE_INTEGER: LowInt64 = (long)managedValue; break; case AdsType.ADSTYPE_BOOLEAN: if ((bool)managedValue) { LowInt64 = -1; } else { LowInt64 = 0; } break; case AdsType.ADSTYPE_CASE_IGNORE_STRING: _pinnedHandle = GCHandle.Alloc(managedValue, GCHandleType.Pinned); adsvalue.pointer.value = _pinnedHandle.AddrOfPinnedObject(); break; case AdsType.ADSTYPE_PROV_SPECIFIC: byte[] bytes = (byte[])managedValue; // filling in an ADS_PROV_SPECIFIC struct. // 1st dword (our member a) is DWORD dwLength. // 2nd dword (our member b) is byte *lpValue. adsvalue.octetString.length = bytes.Length; _pinnedHandle = GCHandle.Alloc(bytes, GCHandleType.Pinned); adsvalue.octetString.value = _pinnedHandle.AddrOfPinnedObject(); break; default: throw new NotImplementedException(String.Format(CultureInfo.CurrentCulture, SR.DSAdsvalueTypeNYI, "0x" + Convert.ToString((int)adsType, 16))); } }
private void SetValue(object managedValue, AdsType adsType) { this.adsvalue = new AdsValue(); this.adsvalue.dwType = (int)adsType; switch (adsType) { case AdsType.ADSTYPE_CASE_IGNORE_STRING: this.pinnedHandle = GCHandle.Alloc(managedValue, GCHandleType.Pinned); this.adsvalue.pointer.value = this.pinnedHandle.AddrOfPinnedObject(); return; case AdsType.ADSTYPE_BOOLEAN: if (!((bool)managedValue)) { this.LowInt64 = 0L; return; } this.LowInt64 = -1L; return; case AdsType.ADSTYPE_INTEGER: this.adsvalue.generic.a = (int)managedValue; this.adsvalue.generic.b = 0; return; case AdsType.ADSTYPE_LARGE_INTEGER: this.LowInt64 = (long)managedValue; return; case AdsType.ADSTYPE_PROV_SPECIFIC: { byte[] buffer = (byte[])managedValue; this.adsvalue.octetString.length = buffer.Length; this.pinnedHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned); this.adsvalue.octetString.value = this.pinnedHandle.AddrOfPinnedObject(); return; } } throw new NotImplementedException(Res.GetString("DSAdsvalueTypeNYI", new object[] { "0x" + Convert.ToString((int)adsType, 0x10) })); }
protected virtual void AdDownloadCallback(AdsType adType, bool result, string message) { if (mCurrentDownload == null) { if (AdsManager.Debugging) { Debug.Log("AdDownload mCurrentDownload is null but there is still have callback"); } return; } if (adType != mCurrentDownload._Type) { if (AdsManager.Debugging) { Debug.Log("AdDownload callback type " + adType + " does not match current download type " + mCurrentDownload._Type); } return; } if (result) { if (AdsManager.Debugging) { Debug.Log("AdDownload " + mCurrentDownload._Type + " id " + mCurrentDownload._Id + " result success"); } mAdLoadState = AdsLoadState.Loaded; } else { if (AdsManager.Debugging) { Debug.Log("AdDownload " + mCurrentDownload._Type + " id " + mCurrentDownload._Id + " result failed: " + message); } mAdLoadState = AdsLoadState.Error; } mCurrentDownload.OnAdAvailabilityUpdate(result); mCurrentDownload = null; }
/// <summary> /// This methods shows ads, after showing - change type of monetization system /// /// </summary> public static void showAndSwitchAds() { switch (currentAdsType) { case AdsType.HeyzApp: if (isHeyzappInited) { if (HZInterstitialAd.isAvailable()) { HZInterstitialAd.show(); currentAdsType = AdsType.AdMob; } } else { Debug.LogWarning("AdsManager: init Heyzapp from showAndSwitchAds"); initInterstitial(); } break; case AdsType.AdMob: if (interstitial != null) { if (interstitial.IsLoaded()) { interstitial.Show(); currentAdsType = AdsType.HeyzApp; } } else { Debug.LogWarning("AdsManager: admob not inited. But we init this after this try"); initInterstitial(); } break; } }
public void hideAds(AdsType adsType, int idx = 1) { AnySDKAds.AnySDKAds_nativeHideAds(adsType, idx); }
protected override AdStatusHandler CreateAdHandler(AdsType type, string id) { return(new MaxAdStatusHandler(type, id)); }
public MaxAdStatusHandler(AdsType type, string id) : base(type, id) { }
public AdsValueHelper(object managedValue, AdsType adsType) { SetValue(managedValue, adsType); }
private static extern void AnySDKAds_nativePreloadAds(AdsType adsType, int idx = 1);
private static extern bool AnySDKAds_nativeIsAdTypeSupported(AdsType adsType);
/** * * @Title: isAdTypeSupported * @Description: does the plugin support the type of ad * @param @param adsType * @param @return * @return boolean */ public bool isAdTypeSupported(AdsType adType) { #if UNITY_ANDROID || UNITY_IOS return AnySDKAds_nativeIsAdTypeSupported (adType); #else Debug.Log("This platform does not support!"); return false; #endif }
public Advertisement(string advName, string advText, AdsType advType) { this.advertisementName = advName; this.advertisementText = advText; this.type = advType; }
private static extern bool GameAds_nativeIsAdTypeSupported(AdsType adsType);
public static async Task <IAdsService> GetAsync(AdsType type) { await new WaitUntil(() => !Get(type).IsNull()); return(Get(type)); }
/** * * @Title: showAds * @Description: show ad with the type and idx * @param @param adsType the type of ad * @param @param idx * @return void */ public void showAds(AdsType adsType, int idx = 1) { #if UNITY_ANDROID || UNITY_IOS AnySDKAds_nativeShowAds (adsType,idx); #else Debug.Log("This platform does not support!"); #endif }
private static extern void AnySDKAds_nativeHideAds(AdsType adsType, int idx = 1);
private void SetValue(object managedValue, AdsType adsType) { this.adsvalue = new AdsValue(); this.adsvalue.dwType = (int) adsType; switch (adsType) { case AdsType.ADSTYPE_CASE_IGNORE_STRING: this.pinnedHandle = GCHandle.Alloc(managedValue, GCHandleType.Pinned); this.adsvalue.pointer.value = this.pinnedHandle.AddrOfPinnedObject(); return; case AdsType.ADSTYPE_BOOLEAN: if (!((bool) managedValue)) { this.LowInt64 = 0L; return; } this.LowInt64 = -1L; return; case AdsType.ADSTYPE_INTEGER: this.adsvalue.generic.a = (int) managedValue; this.adsvalue.generic.b = 0; return; case AdsType.ADSTYPE_LARGE_INTEGER: this.LowInt64 = (long) managedValue; return; case AdsType.ADSTYPE_PROV_SPECIFIC: { byte[] buffer = (byte[]) managedValue; this.adsvalue.octetString.length = buffer.Length; this.pinnedHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned); this.adsvalue.octetString.value = this.pinnedHandle.AddrOfPinnedObject(); return; } } throw new NotImplementedException(Res.GetString("DSAdsvalueTypeNYI", new object[] { "0x" + Convert.ToString((int) adsType, 0x10) })); }
public bool isAdTypeSupported(AdsType adType) { return(AnySDKAds.AnySDKAds_nativeIsAdTypeSupported(adType)); }
public void preloadAds(AdsType adsType, int idx = 1) { AnySDKAds.AnySDKAds_nativePreloadAds(adsType, idx); }
public AdsValueHelper(object managedValue) { AdsType adsType = GetAdsTypeForManagedType(managedValue.GetType()); SetValue(managedValue, adsType); }
private unsafe void SetValue(object managedValue, AdsType adsType) { adsvalue = new AdsValue(); adsvalue.dwType = (int)adsType; switch (adsType) { case AdsType.ADSTYPE_INTEGER: adsvalue.generic.a = (int)managedValue; adsvalue.generic.b = 0; break; case AdsType.ADSTYPE_LARGE_INTEGER: LowInt64 = (long)managedValue; break; case AdsType.ADSTYPE_BOOLEAN: if ((bool)managedValue) LowInt64 = -1; else LowInt64 = 0; break; case AdsType.ADSTYPE_CASE_IGNORE_STRING: _pinnedHandle = GCHandle.Alloc(managedValue, GCHandleType.Pinned); adsvalue.pointer.value = _pinnedHandle.AddrOfPinnedObject(); break; case AdsType.ADSTYPE_PROV_SPECIFIC: byte[] bytes = (byte[])managedValue; // filling in an ADS_PROV_SPECIFIC struct. // 1st dword (our member a) is DWORD dwLength. // 2nd dword (our member b) is byte *lpValue. adsvalue.octetString.length = bytes.Length; _pinnedHandle = GCHandle.Alloc(bytes, GCHandleType.Pinned); adsvalue.octetString.value = _pinnedHandle.AddrOfPinnedObject(); break; default: throw new NotImplementedException(Res.GetString(Res.DSAdsvalueTypeNYI, "0x" + Convert.ToString((int)adsType, 16))); } }
private static extern void GameAds_nativeShowAds(AdsType adsType, int idx = 1);
private static extern void AnySDKAds_nativeShowAds(AdsType adsType, int idx = 1);