public static ModalPanelGetYourCoinControl Instance() { if (!modalPanel) { modalPanel = FindObjectOfType(typeof(ModalPanelGetYourCoinControl)) as ModalPanelGetYourCoinControl; if (!modalPanel) // Make sure that Modalpanel existes. { Debug.Log("There needs to be one active ModalPanelGetYourCoinControl Script on a GameObject in your scene"); } } return(modalPanel); }
//private Button _button; /* * void Start(){ * * _button = GetComponent<Button>(); * * if (_button) _button.onClick.AddListener (delegate() { ShowAdPlacement(); }); * } * * void Update(){ * * if (_button) { * * if (string.IsNullOrEmpty (zoneId)) zoneId = null; * _button.interactable = Advertisement.IsReady (zoneId); * } * }*/ public static void ShowAdPlacement() { AdsOnIsrunnig = true; AdsOnComplet = false; modalPanelGetYourCoinControl = ModalPanelGetYourCoinControl.Instance(); if (string.IsNullOrEmpty(zoneId)) { zoneId = null; } ShowOptions options = new ShowOptions(); options.resultCallback = HandleShowResult; Advertisement.Show(zoneId, options); }