Ejemplo n.º 1
0
    public void Initialize(UIBuyLifePopup _uIBuyLifePopup)
    {
        this.uIBuyLifePopup   = _uIBuyLifePopup;
        myButton              = GetComponent <Button>();
        myButton.interactable = Advertisement.IsReady(myPlacementId);
        if (myButton)
        {
            myButton.onClick.AddListener(ShowRewardedVideo);
        }

        AdsMan.Instance.fastRespawnEvent.SetListener(OnUnityAdsReady);
    }
Ejemplo n.º 2
0
    public void OnGameOverWithRespawnOption()
    {
        UIBuyLifePopup buyLifePopup = GameObject.Instantiate(PoolMan.Instance.uiBuyLifePopupPrefab).GetComponent <UIBuyLifePopup>();

        buyLifePopup.transform.SetParent(this.hudCanvas.transform);
        buyLifePopup.GetComponent <RectTransform>().anchoredPosition = Vector3.zero;
        buyLifePopup.GetComponent <RectTransform>().localScale       = Vector3.one;

        if (EconomyMan.Instance.CanBuy(new Money(Constants.price_respawn, Currency.COOKIE)) || AdsMan.Instance.IsAvailable())
        {
            buyLifePopup.Open(AfterBuyLifesPopup);
        }
        else
        {
            AfterBuyLifesPopup(false);
        }
    }