using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class videoAd : MonoBehaviour { void Start() { AppLovin.SetSdkKey("0UoiuyQNova9_hmqJTnIb2hmvFHUxn35qz0CeWauTwiNZXNUny6i34lyUQwczNDe5tT-b2vz6VmB6IXueuxI4e"); AppLovin.SetUnityAdListener("ApplovinRewarded"); AppLovin.LoadRewardedInterstitial(); } void onAppLovinEventReceived(string ev) { if (ev.Contains("REWARDAPPROVEDINFO")) { //rewand } else if (ev.Contains("LOADEDREWARDED")) { Debug.Log("A rewarded video was successfully loaded."); } else if (ev.Contains("LOADREWARDEDFAILED")) { Debug.Log("A rewarded video failed to load."); } else if (ev.Contains("HIDDENREWARDED")) { Debug.Log("A rewarded video was closed. Preload the next rewarded video."); AppLovin.LoadRewardedInterstitial(); } } public void ApplovinRewarded() { AppLovin.ShowRewardedInterstitial(); AppLovin.LoadRewardedInterstitial(); Debug.Log("should show reward"); } }