public AndroidADBanner(int x, int y, GADBannerSize size, int id) { _id = id; _size = size; AN_GoogleAdProxy.CreateBannerAdPos(x, y, (int)_size, _id); }
//-------------------------------------- // INITIALIZE //-------------------------------------- public AndroidADBanner(TextAnchor anchor, GADBannerSize size, int id) { _id = id; _size = size; _anchor = anchor; AN_GoogleAdProxy.CreateBannerAd((int)gravity, (int)_size, _id); }
public void Refresh() { if (!_IsLoaded) { return; } AN_GoogleAdProxy.RefreshAd(_id); }
public void Pause() { if (!_IsLoaded) { return; } AN_GoogleAdProxy.PauseAd(_id); }
public void Resume() { if (!_IsLoaded) { return; } AN_GoogleAdProxy.ResumeAd(_id); }
public void Show() { if (_IsOnScreen) { return; } _IsOnScreen = true; AN_GoogleAdProxy.ShowAd(_id); }
public void SetBirthday(int year, AndroidMonth month, int day) { if (!_IsInited) { Debug.LogWarning("SetBirthday shoudl be called only after Init function. Call ignored"); return; } AN_GoogleAdProxy.SetBirthday(year, (int)month, day); }
//Set the user's gender for targeting purposes. This should be GADGenger.GENDER_MALE, GADGenger.GENDER_FEMALE, or GADGenger.GENDER_UNKNOWN public void SetGender(GoogleGenger gender) { if (!_IsInited) { Debug.LogWarning("SetGender shoudl be called only after Init function. Call ignored"); return; } AN_GoogleAdProxy.SetGender((int)gender); }
public void TagForChildDirectedTreatment(bool tagForChildDirectedTreatment) { if (!_IsInited) { Debug.LogWarning("TagForChildDirectedTreatment shoudl be called only after Init function. Call ignored"); return; } AN_GoogleAdProxy.TagForChildDirectedTreatment(tagForChildDirectedTreatment); }
public void ShowInterstitialAd() { if (!_IsInited) { Debug.LogWarning("ShowInterstitialAd shoudl be called only after Init function. Call ignored"); return; } AN_GoogleAdProxy.ShowInterstitialAd(); }
//-------------------------------------- // PUBLIC METHODS //-------------------------------------- public void Hide() { if (!_IsOnScreen) { return; } _IsOnScreen = false; AN_GoogleAdProxy.HideAd(_id); }
//-------------------------------------- // BUILDER METHODS //-------------------------------------- //Add a keyword for targeting purposes. public void AddKeyword(string keyword) { if (!_IsInited) { Debug.LogWarning("AddKeyword shoudl be called only after Init function. Call ignored"); return; } AN_GoogleAdProxy.AddKeyword(keyword); }
//Causes a device to receive test ads. The deviceId can be obtained by viewing the logcat output after creating a new ad. public void AddTestDevice(string deviceId) { if (!_IsInited) { Debug.LogWarning("AddTestDevice shoudl be called only after Init function. Call ignored"); return; } AN_GoogleAdProxy.AddTestDevice(deviceId); }
public void Init(string ad_unit_id) { if (_IsInited) { Debug.LogWarning("Init shoudl be called only once. Call ignored"); return; } _IsInited = true; _BannersUunitId = ad_unit_id; _InterstisialUnitId = ad_unit_id; _banners = new Dictionary <int, AndroidADBanner>(); AN_GoogleAdProxy.InitMobileAd(ad_unit_id); }
//-------------------------------------- // EVENTS //-------------------------------------- public void OnBannerAdLoaded() { if (destroyOnLoad) { AN_GoogleAdProxy.DestroyBanner(id); return; } _IsLoaded = true; if (ShowOnLoad && firstLoad) { Show(); firstLoad = false; } _OnLoadedAction(this); }
//Causes a device to receive test ads. The deviceId can be obtained by viewing the logcat output after creating a new ad. public void AddTestDevices(params string[] ids) { if (!_IsInited) { Debug.LogWarning("AddTestDevice shoudl be called only after Init function. Call ignored"); return; } if (ids.Length == 0) { return; } AN_GoogleAdProxy.AddTestDevice(string.Join(DEVICES_SEPARATOR, ids)); }
public void LoadRewardedVideo() { if (!_IsInited) { Debug.LogWarning("ShowRewardedVideo shoudl be called only after Init function. Call ignored"); return; } if (IsEditorTestingEnabled) { SA_EditorAd.OnVideoLoadComplete += HandleOnVideoLoadComplete_Editor; SA_EditorAd.Instance.LoadVideo(); return; } AN_GoogleAdProxy.LoadRewardedVideo(); }
public void LoadInterstitialAd() { if (!_IsInited) { Debug.LogWarning("LoadInterstitialAd shoudl be called only after Init function. Call ignored"); return; } if (IsEditorTestingEnabled) { SA_EditorAd.OnInterstitialLoadComplete += HandleOnInterstitialLoadComplete_Editor; SA_EditorAd.Instance.LoadInterstitial(); return; } AN_GoogleAdProxy.LoadInterstitialAd(); }
//-------------------------------------- // EVENTS //-------------------------------------- public void OnBannerAdLoaded() { if (destroyOnLoad) { AN_GoogleAdProxy.DestroyBanner(id); return; } _IsLoaded = true; if (ShowOnLoad && firstLoad) { Show(); firstLoad = false; } _OnLoadedAction(this); dispatch(GoogleMobileAdEvents.ON_BANNER_AD_LOADED); }
public void ShowRewardedVideo() { if (!_IsInited) { Debug.LogWarning("ShowRewardedVideo shoudl be called only after Init function. Call ignored"); return; } if (IsEditorTestingEnabled) { SA_EditorAd.OnVideoLeftApplication += HandleOnVideoLeftApplication_Editor; SA_EditorAd.OnVideoFinished += HandleOnVideoFinished_Editor; SA_EditorAd.Instance.ShowVideo(); OnRewardedVideoAdOpened(); return; } AN_GoogleAdProxy.ShowRewardedVideo(); }
public void DestroyBanner(int id) { if (_banners != null) { if (_banners.ContainsKey(id)) { AndroidADBanner banner = _banners[id]; if (banner.IsLoaded) { _banners.Remove(id); AN_GoogleAdProxy.DestroyBanner(id); } else { banner.DestroyAfterLoad(); } } } }
public void ShowInterstitialAd() { if (!_IsInited) { Debug.LogWarning("ShowInterstitialAd shoudl be called only after Init function. Call ignored"); return; } if (IsEditorTestingEnabled) { SA_EditorAd.OnInterstitialLeftApplication += HandleOnInterstitialLeftApplication_Editor; SA_EditorAd.OnInterstitialFinished += HandleOnInterstitialFinished_Editor; SA_EditorAd.Instance.ShowInterstitial(); OnInterstitialOpened(); return; } AN_GoogleAdProxy.ShowInterstitialAd(); }
public void Init(string ad_unit_id) { if (_IsInited) { Debug.LogWarning("Init shoudl be called only once. Call ignored"); return; } _IsInited = true; _BannersUunitId = ad_unit_id; _InterstisialUnitId = ad_unit_id; _RewardedVideoAdUnitId = ad_unit_id; _banners = new Dictionary <int, AndroidADBanner>(); if (IsEditorTestingEnabled) { Debug.Log("Initialized with Editor Testing Profile"); SA_EditorAd.Instance.SetFillRate(_EditorFillRate); return; } AN_GoogleAdProxy.InitMobileAd(ad_unit_id); }
public void SetRewardedVideoAdUnitID(string id) { _RewardedVideoAdUnitId = id; AN_GoogleAdProxy.ChangeRewardedVideoUnitID(_RewardedVideoAdUnitId); }
public void SetBannerPosition(TextAnchor anchor) { _anchor = anchor; AN_GoogleAdProxy.SetBannerPosition((int)gravity, id); }
public void SetInterstisialsUnitID(string ad_unit_id) { _InterstisialUnitId = ad_unit_id; AN_GoogleAdProxy.ChangeInterstisialsUnitID(ad_unit_id); }
public void SetBannersUnitID(string ad_unit_id) { _BannersUunitId = ad_unit_id; AN_GoogleAdProxy.ChangeBannersUnitID(ad_unit_id); }
public void RecordInAppResolution(GADInAppResolution resolution) { AN_GoogleAdProxy.RecordInAppResolution((int)resolution); }
public void SetBannerPosition(int x, int y) { AN_GoogleAdProxy.SetBannerPosition(x, y, id); }