Пример #1
0
 void Awake()
 {
     if (instancia == null)
     {
         instancia = this;
         DontDestroyOnLoad(gameObject);
         Advertisement.AddListener(this);
         Advertisement.Initialize("4003231");
     }
     else
     {
         Destroy(gameObject);
     }
 }
Пример #2
0
    public void Start()
    {
        if (instancia == null)
        {
            instancia = this;
        }
#if UNITY_ANDROID
        string appId = "ca-app-pub-1343647000894788~1193651346";
#elif UNITY_IPHONE
        string appId = "ca-app-pub-1343647000894788~1193651346";
#else
        string appId = "unexpected_platform";
#endif

        // Initialize the Google Mobile Ads SDK.
        MobileAds.Initialize(appId);

        // Get singleton reward based video ad reference.
        this.rewardBasedVideo = RewardBasedVideoAd.Instance;

        this.RequestBanner();
    }