Hello there I wrote this to show ads when the player gets to score 3000 however it is not working can you give me a hint on what im doing wrong?
public void AddScore(int n)
{
currentScore += n;
adScore += n;
text_score.text = currentScore.ToString();
if (adScore >= 3000)
{
GetComponent<AdsMan>();
adScore = 0;
}
}
And here is AdsMan:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Advertisements;
public class AdsMan : MonoBehaviour
{
IEnumerator Start()
{
Advertisement.Initialize("-------", true); //dont mind the -'s its correct in the code
while (!Advertisement.IsReady())
{
yield return null;
}
Advertisement.Show();
}
}