forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathADInterstitialAd.cs
More file actions
98 lines (98 loc) · 2.79 KB
/
Copy pathADInterstitialAd.cs
File metadata and controls
98 lines (98 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
using System;
using System.Runtime.CompilerServices;
namespace UnityEngine.iOS
{
public sealed class ADInterstitialAd
{
public delegate void InterstitialWasLoadedDelegate();
private IntPtr interstitialView;
private static bool _AlwaysFalseDummy;
public static event ADInterstitialAd.InterstitialWasLoadedDelegate onInterstitialWasLoaded
{
[MethodImpl(MethodImplOptions.Synchronized)]
add
{
ADInterstitialAd.onInterstitialWasLoaded = (ADInterstitialAd.InterstitialWasLoadedDelegate)Delegate.Combine(ADInterstitialAd.onInterstitialWasLoaded, value);
}
[MethodImpl(MethodImplOptions.Synchronized)]
remove
{
ADInterstitialAd.onInterstitialWasLoaded = (ADInterstitialAd.InterstitialWasLoadedDelegate)Delegate.Remove(ADInterstitialAd.onInterstitialWasLoaded, value);
}
}
public static bool isAvailable
{
get
{
return ADInterstitialAd.Native_InterstitialAvailable();
}
}
public bool loaded
{
get
{
return ADInterstitialAd.Native_InterstitialAdLoaded(this.interstitialView);
}
}
public ADInterstitialAd(bool autoReload)
{
this.CtorImpl(autoReload);
}
public ADInterstitialAd()
{
this.CtorImpl(false);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern IntPtr Native_CreateInterstitial(bool autoReload);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void Native_ShowInterstitial(IntPtr view);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void Native_ReloadInterstitial(IntPtr view);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool Native_InterstitialAdLoaded(IntPtr view);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool Native_InterstitialAvailable();
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void Native_DestroyInterstitial(IntPtr view);
private void CtorImpl(bool autoReload)
{
if (ADInterstitialAd._AlwaysFalseDummy)
{
ADInterstitialAd.FireInterstitialWasLoaded();
}
this.interstitialView = ADInterstitialAd.Native_CreateInterstitial(autoReload);
}
~ADInterstitialAd()
{
ADInterstitialAd.Native_DestroyInterstitial(this.interstitialView);
}
public void Show()
{
if (this.loaded)
{
ADInterstitialAd.Native_ShowInterstitial(this.interstitialView);
}
else
{
Debug.Log("Calling ADInterstitialAd.Show() when the ad is not loaded");
}
}
public void ReloadAd()
{
ADInterstitialAd.Native_ReloadInterstitial(this.interstitialView);
}
private static void FireInterstitialWasLoaded()
{
if (ADInterstitialAd.onInterstitialWasLoaded != null)
{
ADInterstitialAd.onInterstitialWasLoaded();
}
}
}
}