Advertisement
Mintay

Untitled

Dec 14th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. public void ShowRewardedVideo()
  2.     {
  3.         if (IsRealRewardedVideoLoaded())
  4.         {
  5.             Time.timeScale = 0;
  6.  
  7.             Appodeal.show(Appodeal.REWARDED_VIDEO);
  8.  
  9.             MuteSounds();
  10.         }
  11.     }
  12.     public bool IsRealRewardedVideoLoaded()
  13.     {
  14.         if (Appodeal.isLoaded(Appodeal.REWARDED_VIDEO))
  15.             return true;
  16.         else
  17.             return false;
  18.     }
  19.     #region Rewarded Video callback handlers
  20.     public void onRewardedVideoLoaded() { print("Video loaded"); }
  21.     public void onRewardedVideoFailedToLoad() { Time.timeScale = 1; print("Video failed"); TurnBackSounds(); }
  22.     public void onRewardedVideoShown() { Time.timeScale = 1; print("Video shown"); TurnBackSounds(); }
  23.  
  24.     public void onRewardedVideoClosed(bool finished) { Time.timeScale = 1; print("Video closed"); TurnBackSounds(); }
  25.  
  26.     public void onRewardedVideoFinished(int amount, string name)
  27.     {
  28.         Time.timeScale = 1;
  29.         TurnBackSounds();
  30.  
  31.         PersistentDataManager.Instance.firebreathCount++;
  32.        
  33.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement