Esempio n. 1
0
    public AndroidADBanner(int x, int y, GADBannerSize size, int id)
    {
        _id   = id;
        _size = size;


        AN_GoogleAdProxy.CreateBannerAdPos(x, y, (int)_size, _id);
    }
Esempio n. 2
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------

    public AndroidADBanner(TextAnchor anchor, GADBannerSize size, int id)
    {
        _id     = id;
        _size   = size;
        _anchor = anchor;


        AN_GoogleAdProxy.CreateBannerAd((int)gravity, (int)_size, _id);
    }
Esempio n. 3
0
    public void Refresh()
    {
        if (!_IsLoaded)
        {
            return;
        }

        AN_GoogleAdProxy.RefreshAd(_id);
    }
Esempio n. 4
0
    public void Pause()
    {
        if (!_IsLoaded)
        {
            return;
        }

        AN_GoogleAdProxy.PauseAd(_id);
    }
Esempio n. 5
0
    public void Resume()
    {
        if (!_IsLoaded)
        {
            return;
        }

        AN_GoogleAdProxy.ResumeAd(_id);
    }
Esempio n. 6
0
    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();
    }
Esempio n. 11
0
    //--------------------------------------
    //  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);
    }
Esempio n. 15
0
    //--------------------------------------
    //  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));
    }
Esempio n. 17
0
    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();
    }
Esempio n. 18
0
    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();
    }
Esempio n. 19
0
    //--------------------------------------
    //  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);
    }
Esempio n. 20
0
    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();
             }
         }
     }
 }
Esempio n. 22
0
    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();
    }
Esempio n. 23
0
    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);
    }
Esempio n. 24
0
 public void SetRewardedVideoAdUnitID(string id)
 {
     _RewardedVideoAdUnitId = id;
     AN_GoogleAdProxy.ChangeRewardedVideoUnitID(_RewardedVideoAdUnitId);
 }
Esempio n. 25
0
 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);
 }
Esempio n. 29
0
 public void SetBannerPosition(int x, int y)
 {
     AN_GoogleAdProxy.SetBannerPosition(x, y, id);
 }