summaryrefslogtreecommitdiff
path: root/Runtime/Export/iOS/iAD.txt
blob: 725e4e6daeb3748cffb0609ea78b6bd94d041033 (plain)
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
C++RAW

#include "UnityPrefix.h"
#include "Runtime/Math/Vector2.h"
#include "Runtime/Scripting/ScriptingUtility.h"

using namespace Unity;

CSRAW
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Collections;

namespace UnityEngine
{

CONDITIONAL UNITY_IPHONE_API
CLASS ADBannerView

	C++RAW extern void* UnityAD_CreateBanner(int, int);
	C++RAW extern void  UnityAD_DestroyBanner(void*);
	C++RAW extern void  UnityAD_ShowBanner(void*, bool);
	C++RAW extern void  UnityAD_MoveBanner(void*, float, float);
	C++RAW extern void  UnityAD_LayoutBanner(void*, int);
	C++RAW extern bool  UnityAD_BannerTypeAvailable(int);
	C++RAW extern void  UnityAD_BannerPosition(void*, float*, float*);
	C++RAW extern void  UnityAD_BannerSize(void*, float*, float*);
	C++RAW extern bool  UnityAD_BannerAdLoaded(void*);
	C++RAW extern bool  UnityAD_BannerAdVisible(void*);


	CUSTOM private static IntPtr Native_CreateBanner(int type, int layout)			{ return UnityAD_CreateBanner(type, layout); }
	CUSTOM private static void	 Native_ShowBanner(IntPtr view, bool show)			{ UnityAD_ShowBanner(view, show); }
	CUSTOM private static void	 Native_MoveBanner(IntPtr view, Vector2 pos)		{ UnityAD_MoveBanner(view, pos.x, pos.y); }
	CUSTOM private static void	 Native_LayoutBanner(IntPtr view, int layout)		{ UnityAD_LayoutBanner(view, layout); }
	CUSTOM private static bool	 Native_BannerTypeAvailable(int type)				{ return UnityAD_BannerTypeAvailable(type); }
	CUSTOM private static void	 Native_BannerPosition(IntPtr view, out Vector2 pos){ UnityAD_BannerPosition(view, &pos->x, &pos->y); }
	CUSTOM private static void	 Native_BannerSize(IntPtr view, out Vector2 pos)	{ UnityAD_BannerSize(view, &pos->x, &pos->y); }
	CUSTOM private static bool 	 Native_BannerAdLoaded(IntPtr view)					{ return UnityAD_BannerAdLoaded(view); }
	CUSTOM private static bool 	 Native_BannerAdVisible(IntPtr view)				{ return UnityAD_BannerAdVisible(view); }


	THREAD_SAFE CUSTOM private static void 	Native_DestroyBanner(IntPtr view)		{ UnityAD_DestroyBanner(view); }

END

CONDITIONAL UNITY_IPHONE_API
CLASS ADInterstitialAd

	C++RAW extern void* UnityAD_CreateInterstitial(bool);
	C++RAW extern void  UnityAD_DestroyInterstitial(void*);
	C++RAW extern void  UnityAD_ShowInterstitial(void*);
	C++RAW extern void  UnityAD_ReloadInterstitial(void*);
	C++RAW extern bool  UnityAD_InterstitialAvailable();
	C++RAW extern bool  UnityAD_InterstitialAdLoaded(void*);


	CUSTOM private static IntPtr	Native_CreateInterstitial(bool autoReload)		{ return UnityAD_CreateInterstitial(autoReload); }
	CUSTOM private static void 		Native_ShowInterstitial(IntPtr view)			{ UnityAD_ShowInterstitial(view); }
	CUSTOM private static void 		Native_ReloadInterstitial(IntPtr view)			{ UnityAD_ReloadInterstitial(view); }
	CUSTOM private static bool 		Native_InterstitialAdLoaded(IntPtr view)		{ return UnityAD_InterstitialAdLoaded(view); }
	CUSTOM private static bool 		Native_InterstitialAvailable()					{ return UnityAD_InterstitialAvailable(); }


	THREAD_SAFE CUSTOM private static void Native_DestroyInterstitial(IntPtr view)	{ UnityAD_DestroyInterstitial(view); }
END


CSRAW
}

C++RAW
#if !UNITY_IPHONE
	void* UnityAD_CreateBanner(int, int)				{ return 0; }
	void  UnityAD_DestroyBanner(void*)					{}
	void  UnityAD_ShowBanner(void*, bool)				{}
	void  UnityAD_MoveBanner(void*, float, float)		{}
	void  UnityAD_LayoutBanner(void*, int)				{}
	bool  UnityAD_BannerTypeAvailable(int)				{ return false; }
	void  UnityAD_BannerPosition(void*, float*, float*)	{}
	void  UnityAD_BannerSize(void*, float*, float*)		{}
	bool  UnityAD_BannerAdLoaded(void*)					{ return false; }
	bool  UnityAD_BannerAdVisible(void*)				{ return false; }
	void* UnityAD_CreateInterstitial(bool)				{ return 0; }
	void  UnityAD_DestroyInterstitial(void*)			{}
	void  UnityAD_ShowInterstitial(void*)				{}
	void  UnityAD_ReloadInterstitial(void*)				{}
	bool  UnityAD_InterstitialAvailable()				{ return false; }
	bool  UnityAD_InterstitialAdLoaded(void*)			{ return false; }
#endif