Beispiel #1
0
    void Init()
    {
        //Instatiate TopAds Prefab
        TopAdsBehaviour topAds = Instantiate(topAdsPrefab);

        DontDestroyOnLoad(topAds.gameObject);

        //Initialize TopAds
        TopAds.InitializeSDK();

        //Set VoodooSauce tracking events
        TopAds.OnAdLoadedEvent += VoodooSauce.OnAdLoaded;
        TopAds.OnAdFailedEvent += VoodooSauce.OnAdLoadingFail;
        TopAds.OnAdShownEvent  += VoodooSauce.OnAdShown;

        //Set ad id list
        VoodooSauce.SetAdUnitIDs(adUnitIDList);

        //Display toast
        _ShowAndroidToastMessage("Hello Voodoo!");

        //Line added to see RGPD PopUp in Editor at every launch
#if UNITY_EDITOR
        PlayerPrefs.DeleteAll();
#endif

        //We check in playerPref if consent is granted or revoked
        //If consent hasn't granted nor revoked we ask for it
        if (!PlayerPrefs.HasKey("consent"))
        {
            Instantiate(GDPRPopUpPrefab);
        }
        else
        {
            if (PlayerPrefs.GetInt("consent") != 0)
            {
                VoodooSauce.GrantConsent();
            }
            else
            {
                VoodooSauce.RevokeConsent();
            }
            GoToMainScene();
        }
    }
Beispiel #2
0
 public void GrantConsent()
 {
     VoodooSauce.GrantConsent();
     InitSceneController.instance.GoToMainScene();
 }