Exemplo n.º 1
0
	void Awake()
	{
		if(!Instance){
			Instance = this;
			DontDestroyOnLoad(this);
		} else {
			Destroy(this.gameObject);
			Debug.LogWarning("You have duplicate AdMob Managers in your scene!");
		}
		
		AdmobAdAgent.RetainGameObject(ref _instanceFound, gameObject, null);
		AdmobAd.Instance();
	}
Exemplo n.º 2
0
    void Awake()
    {
        if (!Instance)
        {
            Instance = this;
            DontDestroyOnLoad(this);
        }
        else
        {
            Destroy(this.gameObject);
            Debug.LogWarning("You have duplicate AdMob Managers in your scene!");
        }

        AdmobAdAgent.RetainGameObject(ref _instanceFound, gameObject, null);
        AdmobAd.Instance();
    }
    void Awake()
    {
        if (Instance)
        {
            DebugLog("You have duplicate AdMob_Manager.cs scripts in your scene! Admob might not work as expected!");
            Destroy(gameObject);
            return;
        }

        Instance = this;
        DontDestroyOnLoad(this);

        if (EnableAdMob)
        {
            AdmobAdAgent.RetainGameObject(ref AdMobAndroidReady, gameObject, null);
            AdIns = AdmobAd.Instance();
        }
    }
    void Awake()
    {
        if (Instance)
        {
            DebugLog("You have duplicate AdMob_Manager.cs scripts in your scene! Admob might not work as expected!");
            return;
        }

        Instance = (Instance == null ? this : Instance);

        SetupRequirements();

        if (!EnableAdMob)
        {
            DebugLog("AdMob is NOT enabled! No adverts will be triggered!", true);
            return;
        }

        if (EnableTestMode)
        {
            DebugLog("This build has admob set to debug mode! Remember to disable before release!", true);
        }

        if (TagForChildDirectedTreatment)
        {
            DebugLog("Ads for this game are being tagged for child directed treatment!", true);
        }

        // LOAD (not display) an interstitial on awake if the option is selected
        if (IntLoadOnStart)
        {
            LoadInterstitial(false);
        }

        // LOAD (not display) a banner if the option is selected
        if (BannerLoadOnStart)
        {
            LoadBanner(AdSize.SmartBanner, BannerLoadOnStartPos, BannerShowOnStart);
        }
    }
    void Awake()
    {
        if(Instance){
            DebugLog("You have duplicate AdMob_Manager.cs scripts in your scene! Admob might not work as expected!");
            Destroy (gameObject);
            return;
        }

        Instance = this;
        DontDestroyOnLoad(this);

        if(EnableAdMob){
            AdmobAdAgent.RetainGameObject(ref AdMobAndroidReady, gameObject, null);
            AdIns = AdmobAd.Instance();
        }
    }