我是 unity 的新手;我只是想在代码源上测试一些东西,所以我聘请了一个自由职业者来实现广告 广告在玩家输了 3 次后显示,在暂停菜单中,我想每次玩家输了都显示,你能告诉我怎么做吗?做到这一点并且要具体,因为我是这一切的新手
这是我的广告控件
我真的很感激你的帮助
最好的毕业生
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class UIManager : MonoBehaviour
{
public GameObject maskPanel, pausePanel, retrievePanel, gameOverPanel, levelClearPanel;
public Text timerText, coinValueText;
public float timeMax;
private float currentTimer;
public GameObject[] heart;
public int coinToRetrieve;
public Sprite[] starSpr;
public Image starImg;
public Text coinResultValue;
void Awake ()
{
GameManager._UIManager = this;
}
// Use this for initialization
void Start ()
{
currentTimer = timeMax;
coinValueText.text = GameManager._gotCoin.ToString ();
AudioManager.Instance.mainMusic.mute = false;
}
// Update is called once per frame
void Update ()
{
if (Mathf.CeilToInt (currentTimer) > 0) {
currentTimer -= Time.deltaTime;
timerText.text = Mathf.CeilToInt (currentTimer).ToString ();
}
if (Mathf.CeilToInt (currentTimer) == 0) {
if (!GameManager.isGameOver) {
AudioManager.Instance.PlayOutOfTime ();
GameManager.isGameOver = true;
StartCoroutine (GameOver ());
}
}
coinValueText.text = GameManager._gotCoin.ToString ();
}
public void Pause ()
{
AdsControl.Instance.showAds ();
Time.timeScale = 0.0f;
maskPanel.SetActive (true);
pausePanel.SetActive (true);
}
public void Resume ()
{
Time.timeScale = 1.0f;
maskPanel.SetActive (false);
pausePanel.SetActive (false);
}
狐的传说
临摹微笑
相关分类