0
我試圖在重新啓動遊戲時顯示廣告5次後重新啓動。這是我迄今爲止所擁有的。這不起作用。這已經過測試。當restartNum
是5
,這將是true
只一次Unity3D顯示每5次重新啓動一次
private int restartNum {
get {
return PlayerPrefs.GetInt ("restartNum");
}
set {
PlayerPrefs.SetInt ("restartNum", value);
}
}
public void OnButtonClick(string sceneName)
{
restartNum += 1;
if (restartNum == 5) {// adding this makes it not work
ShowAd();// This works by itself
restartNum = 0;
}
SceneManager.LoadScene (sceneName);
}
好的,那是怎麼回事?你測試過了嗎?它工作嗎?你沒有說,如果有問題..... – Programmer
我認爲它不工作是顯而易見的...我編輯了問題,雖然 – Lynnstrum
不是一個很好的方式來問一個問題。你必須說明你的問題是什麼。即使在編輯之後,你也沒有提及現在正在發生的事情。你只是說「它不工作」。我能夠追查到這個問題。檢查我的答案。 – Programmer