From a49c13ab80a76ec81f36d6cbc8c37721f24f828c Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Thu, 18 Jan 2018 12:34:12 +0100 Subject: ads? --- Penguloon/AdManager.cs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Penguloon/AdManager.cs (limited to 'Penguloon/AdManager.cs') diff --git a/Penguloon/AdManager.cs b/Penguloon/AdManager.cs new file mode 100644 index 0000000..af49d17 --- /dev/null +++ b/Penguloon/AdManager.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using Android.App; +using Android.Content; +using Android.OS; +using Android.Runtime; +using Android.Views; +using Android.Widget; + +using Android.Gms.Ads; +using System.Threading; + +namespace Penguloon +{ + /// + /// app id: ca-app-pub-5292616698166001~9916384676 + /// + /// + public static class AdManager + { + public static InterstitialAd GameOverAd { get; set; } + + public static void Load(Main main) + { + GameOverAd = new InterstitialAd(main.Context); + GameOverAd.AdUnitId = "ca-app-pub-5292616698166001/6013632836"; + GameOverAd.LoadAd(new AdRequest.Builder().Build()); + } + + public static void ShowGameOverAd() + { + if (GameOverAd.IsLoaded) + GameOverAd.Show(); + } + } +} \ No newline at end of file -- cgit v1.2.3-70-g09d2