Hello, Tudor here!
I'm creating a game called Cube Quest. I have this code putted on the camera:
using System;
using UnityEngine;
using UnityEngine.Advertisements;
public class UnityAdsStart : MonoBehaviour {
void Awake() {
if (Advertisement.isSupported) {
Advertisement.allowPrecache = true;
Advertisement.Initialize ("22972");
} else {
Debug.Log("Platform not supported");
}
}
void Start() {
if(Advertisement.isReady()){
Advertisement.Show();
PlayerPrefs.SetInt("CubePointsLvl",PlayerPrefs.GetInt("CubePointsLvl") + 50);
}
}
}
In the editor, it is working, but on my phone (Android) it is not. So what is the problem?
↧