265 lines
9.0 KiB
C#
265 lines
9.0 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 IronSourceBannerEventsWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(IronSourceBannerEvents);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 7, 0, 0);
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "onAdLoadedEvent", _e_onAdLoadedEvent);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "onAdLoadFailedEvent", _e_onAdLoadFailedEvent);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "onAdClickedEvent", _e_onAdClickedEvent);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "onAdScreenPresentedEvent", _e_onAdScreenPresentedEvent);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "onAdScreenDismissedEvent", _e_onAdScreenDismissedEvent);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "onAdLeftApplicationEvent", _e_onAdLeftApplicationEvent);
|
|
|
|
|
|
|
|
|
|
|
|
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 IronSourceBannerEvents();
|
|
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 IronSourceBannerEvents constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _e_onAdLoadedEvent(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
System.Action<IronSourceAdInfo> gen_delegate = translator.GetDelegate<System.Action<IronSourceAdInfo>>(L, 2);
|
|
if (gen_delegate == null) {
|
|
return LuaAPI.luaL_error(L, "#2 need System.Action<IronSourceAdInfo>!");
|
|
}
|
|
|
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "+")) {
|
|
IronSourceBannerEvents.onAdLoadedEvent += gen_delegate;
|
|
return 0;
|
|
}
|
|
|
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "-")) {
|
|
IronSourceBannerEvents.onAdLoadedEvent -= gen_delegate;
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to IronSourceBannerEvents.onAdLoadedEvent!");
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _e_onAdLoadFailedEvent(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
System.Action<IronSourceError> gen_delegate = translator.GetDelegate<System.Action<IronSourceError>>(L, 2);
|
|
if (gen_delegate == null) {
|
|
return LuaAPI.luaL_error(L, "#2 need System.Action<IronSourceError>!");
|
|
}
|
|
|
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "+")) {
|
|
IronSourceBannerEvents.onAdLoadFailedEvent += gen_delegate;
|
|
return 0;
|
|
}
|
|
|
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "-")) {
|
|
IronSourceBannerEvents.onAdLoadFailedEvent -= gen_delegate;
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to IronSourceBannerEvents.onAdLoadFailedEvent!");
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _e_onAdClickedEvent(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
System.Action<IronSourceAdInfo> gen_delegate = translator.GetDelegate<System.Action<IronSourceAdInfo>>(L, 2);
|
|
if (gen_delegate == null) {
|
|
return LuaAPI.luaL_error(L, "#2 need System.Action<IronSourceAdInfo>!");
|
|
}
|
|
|
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "+")) {
|
|
IronSourceBannerEvents.onAdClickedEvent += gen_delegate;
|
|
return 0;
|
|
}
|
|
|
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "-")) {
|
|
IronSourceBannerEvents.onAdClickedEvent -= gen_delegate;
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to IronSourceBannerEvents.onAdClickedEvent!");
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _e_onAdScreenPresentedEvent(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
System.Action<IronSourceAdInfo> gen_delegate = translator.GetDelegate<System.Action<IronSourceAdInfo>>(L, 2);
|
|
if (gen_delegate == null) {
|
|
return LuaAPI.luaL_error(L, "#2 need System.Action<IronSourceAdInfo>!");
|
|
}
|
|
|
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "+")) {
|
|
IronSourceBannerEvents.onAdScreenPresentedEvent += gen_delegate;
|
|
return 0;
|
|
}
|
|
|
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "-")) {
|
|
IronSourceBannerEvents.onAdScreenPresentedEvent -= gen_delegate;
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to IronSourceBannerEvents.onAdScreenPresentedEvent!");
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _e_onAdScreenDismissedEvent(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
System.Action<IronSourceAdInfo> gen_delegate = translator.GetDelegate<System.Action<IronSourceAdInfo>>(L, 2);
|
|
if (gen_delegate == null) {
|
|
return LuaAPI.luaL_error(L, "#2 need System.Action<IronSourceAdInfo>!");
|
|
}
|
|
|
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "+")) {
|
|
IronSourceBannerEvents.onAdScreenDismissedEvent += gen_delegate;
|
|
return 0;
|
|
}
|
|
|
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "-")) {
|
|
IronSourceBannerEvents.onAdScreenDismissedEvent -= gen_delegate;
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to IronSourceBannerEvents.onAdScreenDismissedEvent!");
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _e_onAdLeftApplicationEvent(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
System.Action<IronSourceAdInfo> gen_delegate = translator.GetDelegate<System.Action<IronSourceAdInfo>>(L, 2);
|
|
if (gen_delegate == null) {
|
|
return LuaAPI.luaL_error(L, "#2 need System.Action<IronSourceAdInfo>!");
|
|
}
|
|
|
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "+")) {
|
|
IronSourceBannerEvents.onAdLeftApplicationEvent += gen_delegate;
|
|
return 0;
|
|
}
|
|
|
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "-")) {
|
|
IronSourceBannerEvents.onAdLeftApplicationEvent -= gen_delegate;
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to IronSourceBannerEvents.onAdLeftApplicationEvent!");
|
|
}
|
|
|
|
}
|
|
}
|