Answer the question
In order to leave comments, you need to log in
How to make it so that when viewing ads they give + 1 point?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Advertisements;
using UnityEngine.UI;
public class UnityAds : MonoBehaviour, IUnityAdsListener
{
string placement = "rewardedVideo";
public Text moneyTxt;
void Start()
{
Advertisement.AddListener(this);
Advertisement.Initialize("------", true);
}
public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
{
if (showResult == ShowResult.Finished)
{
moneyTxt.text = "<size=40><color=#D79242>Money:" ;
}
else if (showResult == ShowResult.Failed)
{
//On no!
}
}
public void OnUnityAdsDidStart(string placementId)
{
}
public void OnUnityAdsReady(string placementId)
{
}
public void OnUnityAdsDidError(string message)
{
}
void UnityAdd()
{
Advertisement.Initialize("4037106", true);
}
public void ShowUnityAD(string p)
{
Advertisement.Show(p);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question