Best Mobile Ads

Mobile Ads (GDPR Compliant)

The asset = https://assetstore.unity.com/packages/tools/integration/mobile-ads-gdpr-compliant-102892

 

 

					

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class AdScene : MonoBehaviour
{
  

    public GameObject panelQ, panelA;

    void Start()
    {
        if (Advertisements.Instance.UserConsentWasSet() == false)
        {
    
            
                panelQ.SetActive(true);
                

            }
            else
            {
                panelQ.SetActive(false);

                StartCoroutine(StartGame());
            }
     }
    
        public void Random()
        {
            Advertisements.Instance.SetUserConsent(false);
            panelQ.SetActive(false);
            StartCoroutine(StartGame());

           
        }
        public void Relevant()
        {
            Advertisements.Instance.SetUserConsent(true);
            panelQ.SetActive(false);
            StartCoroutine(StartGame());
           
        }

        IEnumerator StartGame()
        {
            panelA.SetActive(true);

            Advertisements.Instance.Initialize();

            yield return new WaitForSeconds(2);
            SceneManager.LoadScene(1);
    }
}