public void Ads() { Advertisement.AddListener(this); if (Ready) { Advertisement.Show(myPlacementId); } else { pressed = true; PanelWait.SetActive(true); timeWait = Time.time; } }
void CheckPanelWait() { if (pressed) { if (Ready) { pressed = false; Advertisement.Show(myPlacementId); PanelWait.SetActive(false); this.gameObject.SetActive(false); canvas.SetActive(true); } if (Time.time - timeWait > 10) { pressed = false; PanelWait.SetActive(false); PanelCanceled.SetActive(true); } } }