406 lines
13 KiB
C#
406 lines
13 KiB
C#
#if USE_UNI_LUA
|
|
using LuaAPI = UniLua.Lua;
|
|
using RealStatePtr = UniLua.ILuaState;
|
|
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
|
|
#else
|
|
using LuaAPI = XLua.LuaDLL.Lua;
|
|
using RealStatePtr = System.IntPtr;
|
|
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
|
|
#endif
|
|
|
|
using XLua;
|
|
using System.Collections.Generic;
|
|
|
|
|
|
namespace XLua.CSObjectWrap
|
|
{
|
|
using Utils = XLua.Utils;
|
|
public class FBWindowsADSManagerWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(FBWindowsADSManager);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 8, 3, 3);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadRewardedVideo", _m_LoadRewardedVideo);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "ShowRewardedVideo", _m_ShowRewardedVideo);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadInterstitialAd", _m_LoadInterstitialAd);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "ShowInterstitialAd", _m_ShowInterstitialAd);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnButtonLoadInterstitialAd", _m_OnButtonLoadInterstitialAd);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnButtonShowInterstitialAd", _m_OnButtonShowInterstitialAd);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnButtonLoadRewardedVideo", _m_OnButtonLoadRewardedVideo);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnButtonShowRewardedVideo", _m_OnButtonShowRewardedVideo);
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "Logger", _g_get_Logger);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "InputInterstitialAd", _g_get_InputInterstitialAd);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "InputRewardedVideo", _g_get_InputRewardedVideo);
|
|
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "Logger", _s_set_Logger);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "InputInterstitialAd", _s_set_InputInterstitialAd);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "InputRewardedVideo", _s_set_InputRewardedVideo);
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Utils.EndClassRegister(type, L, translator);
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __CreateInstance(RealStatePtr L)
|
|
{
|
|
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
if(LuaAPI.lua_gettop(L) == 1)
|
|
{
|
|
|
|
var gen_ret = new FBWindowsADSManager();
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to FBWindowsADSManager constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LoadRewardedVideo(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _placementID = LuaAPI.lua_tostring(L, 2);
|
|
|
|
gen_to_be_invoked.LoadRewardedVideo( _placementID );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ShowRewardedVideo(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _placementID = LuaAPI.lua_tostring(L, 2);
|
|
|
|
gen_to_be_invoked.ShowRewardedVideo( _placementID );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LoadInterstitialAd(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _placementID = LuaAPI.lua_tostring(L, 2);
|
|
|
|
gen_to_be_invoked.LoadInterstitialAd( _placementID );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ShowInterstitialAd(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _placementID = LuaAPI.lua_tostring(L, 2);
|
|
|
|
gen_to_be_invoked.ShowInterstitialAd( _placementID );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_OnButtonLoadInterstitialAd(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.OnButtonLoadInterstitialAd( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_OnButtonShowInterstitialAd(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.OnButtonShowInterstitialAd( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_OnButtonLoadRewardedVideo(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.OnButtonLoadRewardedVideo( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_OnButtonShowRewardedVideo(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.OnButtonShowRewardedVideo( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_Logger(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.Logger);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_InputInterstitialAd(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.InputInterstitialAd);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_InputRewardedVideo(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.InputRewardedVideo);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_Logger(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.Logger = (FBWindowsLogsManager)translator.GetObject(L, 2, typeof(FBWindowsLogsManager));
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_InputInterstitialAd(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.InputInterstitialAd = (UnityEngine.UI.InputField)translator.GetObject(L, 2, typeof(UnityEngine.UI.InputField));
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_InputRewardedVideo(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
FBWindowsADSManager gen_to_be_invoked = (FBWindowsADSManager)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.InputRewardedVideo = (UnityEngine.UI.InputField)translator.GetObject(L, 2, typeof(UnityEngine.UI.InputField));
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|