Herkese merhaba,
2 haftadadır denemediğim yol kalamdı. test reklamını gösteriyor ancak ödül fonksiyonu çalıştırmıyor . ana sahneden pause menusünden buttona tıklıyacam ve ödül reklamı açılcak başarılı olursa panel aktif olcak ancak test reklamı oynuyor ödül resminin olduğu panel açılmıyor ( yardimpa.SetActive(true) ). Lütfen bilgisi olan yardımcı olabilir mi resmen akıl tutulması yaşıyorum herşeyi bitirdik sonda patladık
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using UnityEngine.UI;
using GoogleMobileAds;
using GoogleMobileAds.Api;
public class Reklam : MonoBehaviour
{
public GameObject yardimpa;
private RewardBasedVideoAd rAd;
public string id = "";
public Button rewardButton;
private void Start()
{
rAd = RewardBasedVideoAd.Instance;
rAd.OnAdRewarded += VideoRewarded;
rAd.OnAdClosed += VideoClosed;
yardimpa.SetActive(false);
this.RequestAds();
MobileAds.Initialize(initStatus => { });
rewardButton.interactable = true;
}
private void RequestAds()
{
AdRequest request = new AdRequest.Builder().Build();
this.rAd.LoadAd(request, id);
}
private void VideoRewarded(object sender, EventArgs e)
{
Reward();
}
private void VideoClosed(object sender, EventArgs e)
{
RequestAds();
}
public void ShowAds()
{
this.rAd.Show();
}
private void Reward()
{
yardimpa.SetActive(true);
}
private void Update()
{
if (rAd.IsLoaded())
{
rewardButton.interactable = true;
}
else
{
rewardButton.interactable = false;
}
}
}