public void ShowRewardedVideo(System.Action onAnyResult, System.Action onSuccess, System.Action onFailed = null, System.Action onSkipped = null) { if (Debug.isDebugBuild) { AdmobController.Instance.ShowFakeAd("Incentivized", onSuccess, onFailed, onSkipped); return; } if (videoIsRequested) { return; } System.Action <ShowResult> onAdsShown = (result) => {/* #if UNITY_EDITOR * result = ShowResult.Finished; #endif*/ videoIsRequested = false; onAnyResult?.Invoke(); switch (result) { case ShowResult.Finished: onSuccess?.Invoke(); break; case ShowResult.Skipped: if (!string.IsNullOrEmpty(msgSkipped)) { string msg = DLocalizationManager.Instance.GetLocalText(msgSkipped); ToastMessage.ShowCustom(msg); } onFailed?.Invoke(); break; case ShowResult.Failed: if (!string.IsNullOrEmpty(msgError)) { string msg = DLocalizationManager.Instance.GetLocalText(msgError); ToastMessage.ShowCustom(msg); } onSkipped?.Invoke(); break; } }; videoIsRequested = true; // Только если нет Admob Reward, обращаемся к Unity ADS. if (!AdmobController.Instance.RewardAdsOperator(onAdsShown)) { #if UNITY_ADS StartCoroutine(ShowRewardedVideo(onAdsShown)); #else onAdsShown?.Invoke(ShowResult.Failed); #endif } }