public void ForceCloseAds()
 {
     CurrentCrossPromo = null;
     if (_currentPromoPanel != null)
     {
         _currentPromoPanel.DeactivatePanel();
         _currentPromoPanel = null;
     }
 }
        public void ShowCrossPromoAds(PromoAdsStyle type, float duration)
        {
            if (ExternalAdsAvailable) //when external ads are present cross promo ads are ignored
            {
                Debug.Log("External Ads is available, cross promo ads are not shown.");
                return;
            }

            var initIndex = Random.Range(0, PromoData.Count);

            CurrentCrossPromo = PromoData.JumpBy(initIndex, 1, out initIndex);
            _lastDuration     = duration;

            if (CurrentCrossPromo != null)
            {
                var correctType = AvailableAdsType.Find(x => x.AdsStyle == type);
                if (correctType != null)
                {
                    _currentPromoPanel = correctType.AdsPanel;
                }

                if (_currentPromoPanel == null)
                {
                    return;
                }

                switch (type)
                {
                case PromoAdsStyle.Banner:
                {
                    _currentPromoPanel.SetPromoPanel(() => OnClick(CurrentCrossPromo), CurrentCrossPromo.Banner,
                                                     duration, ResetBanner); //force deactivate when necessary
                }
                break;

                case PromoAdsStyle.Fullscreen:
                {
                    _currentPromoPanel.SetPromoPanel(() => OnClick(CurrentCrossPromo), CurrentCrossPromo.Fullscreen,
                                                     duration, ForceCloseAds);
                }
                break;
                }

                _currentPromoPanel.ActivatePanel();
            }
        }