Hello, I am a beginner, thank you for your help.
Rewarded Ads work perfectly but I need to reward the player with tips, not coins or anything like that. My code works in the player but not on android device. What is wrong?
I am using Unity 2018.2.17f1
Thank you
using System.Collections;
using UnityEngine;
using UnityEngine.Monetization;
using UnityEngine.UI;
public class RewardedAdsPlacement : MonoBehaviour
{
public Text Tips;
public Text Tips01;
public string placementId = "rewardedVideo";
public void ShowAd()
{
StartCoroutine(WaitForAd());
}
IEnumerator WaitForAd()
{
while (!Monetization.IsReady(placementId))
{
yield return null;
}
ShowAdPlacementContent ad = null;
ad = Monetization.GetPlacementContent(placementId) as ShowAdPlacementContent;
if (ad != null)
{
ad.Show(AdFinished);
}
}
void AdFinished(ShowResult result)
{
if (result == ShowResult.Finished)
{
// Reward the player
Tips.GetComponent<Text>().text = "Tips : " + Tips01.GetComponent<Text>().text;
}
}
void Update()
{
}
}