719 lines
25 KiB
C#
719 lines
25 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 IAPManagerWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(IAPManager);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 16, 2, 2);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnInitialized", _m_OnInitialized);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnInitializeFailed", _m_OnInitializeFailed);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Buy", _m_Buy);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnPurchaseFailed", _m_OnPurchaseFailed);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "ProcessPurchase", _m_ProcessPurchase);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "ConsumePurchase", _m_ConsumePurchase);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "RestorePurchases", _m_RestorePurchases);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "AnalysisSubscriptionProduct", _m_AnalysisSubscriptionProduct);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsInitialized", _m_IsInitialized);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetApplicationUsername", _m_SetApplicationUsername);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "MoneyStrSale", _m_MoneyStrSale);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "MoneySplit", _m_MoneySplit);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetLocalizedPrice", _m_GetLocalizedPrice);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetLocalizedIsoCurrencyCode", _m_GetLocalizedIsoCurrencyCode);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetLocalizedPriceAmount", _m_GetLocalizedPriceAmount);
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "initCallback", _g_get_initCallback);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "buyCallback", _g_get_buyCallback);
|
|
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "initCallback", _s_set_initCallback);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "buyCallback", _s_set_buyCallback);
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 2, 2, 1);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetProductIdById", _m_GetProductIdById_xlua_st_);
|
|
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "Instance", _g_get_Instance);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "instance", _g_get_instance);
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "instance", _s_set_instance);
|
|
|
|
|
|
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 IAPManager();
|
|
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 IAPManager constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Init(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
System.Collections.Generic.List<ProductInfo> _infos = (System.Collections.Generic.List<ProductInfo>)translator.GetObject(L, 2, typeof(System.Collections.Generic.List<ProductInfo>));
|
|
|
|
gen_to_be_invoked.Init( _infos );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_OnInitialized(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Purchasing.IStoreController _controller = (UnityEngine.Purchasing.IStoreController)translator.GetObject(L, 2, typeof(UnityEngine.Purchasing.IStoreController));
|
|
UnityEngine.Purchasing.IExtensionProvider _extensions = (UnityEngine.Purchasing.IExtensionProvider)translator.GetObject(L, 3, typeof(UnityEngine.Purchasing.IExtensionProvider));
|
|
|
|
gen_to_be_invoked.OnInitialized( _controller, _extensions );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_OnInitializeFailed(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 2&& translator.Assignable<UnityEngine.Purchasing.InitializationFailureReason>(L, 2))
|
|
{
|
|
UnityEngine.Purchasing.InitializationFailureReason _error;translator.Get(L, 2, out _error);
|
|
|
|
gen_to_be_invoked.OnInitializeFailed( _error );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
if(gen_param_count == 3&& translator.Assignable<UnityEngine.Purchasing.InitializationFailureReason>(L, 2)&& (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
|
|
{
|
|
UnityEngine.Purchasing.InitializationFailureReason _error;translator.Get(L, 2, out _error);
|
|
string _message = LuaAPI.lua_tostring(L, 3);
|
|
|
|
gen_to_be_invoked.OnInitializeFailed( _error, _message );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
return LuaAPI.luaL_error(L, "invalid arguments to IAPManager.OnInitializeFailed!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Buy(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _productId = LuaAPI.lua_tostring(L, 2);
|
|
string _payload = LuaAPI.lua_tostring(L, 3);
|
|
|
|
var gen_ret = gen_to_be_invoked.Buy( _productId, _payload );
|
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_OnPurchaseFailed(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 3&& translator.Assignable<UnityEngine.Purchasing.Product>(L, 2)&& translator.Assignable<UnityEngine.Purchasing.PurchaseFailureReason>(L, 3))
|
|
{
|
|
UnityEngine.Purchasing.Product _pro = (UnityEngine.Purchasing.Product)translator.GetObject(L, 2, typeof(UnityEngine.Purchasing.Product));
|
|
UnityEngine.Purchasing.PurchaseFailureReason _p;translator.Get(L, 3, out _p);
|
|
|
|
gen_to_be_invoked.OnPurchaseFailed( _pro, _p );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
if(gen_param_count == 3&& translator.Assignable<UnityEngine.Purchasing.Product>(L, 2)&& translator.Assignable<UnityEngine.Purchasing.Extension.PurchaseFailureDescription>(L, 3))
|
|
{
|
|
UnityEngine.Purchasing.Product _pro = (UnityEngine.Purchasing.Product)translator.GetObject(L, 2, typeof(UnityEngine.Purchasing.Product));
|
|
UnityEngine.Purchasing.Extension.PurchaseFailureDescription _p = (UnityEngine.Purchasing.Extension.PurchaseFailureDescription)translator.GetObject(L, 3, typeof(UnityEngine.Purchasing.Extension.PurchaseFailureDescription));
|
|
|
|
gen_to_be_invoked.OnPurchaseFailed( _pro, _p );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
return LuaAPI.luaL_error(L, "invalid arguments to IAPManager.OnPurchaseFailed!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ProcessPurchase(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Purchasing.PurchaseEventArgs _e = (UnityEngine.Purchasing.PurchaseEventArgs)translator.GetObject(L, 2, typeof(UnityEngine.Purchasing.PurchaseEventArgs));
|
|
|
|
var gen_ret = gen_to_be_invoked.ProcessPurchase( _e );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ConsumePurchase(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _productId = LuaAPI.lua_tostring(L, 2);
|
|
|
|
gen_to_be_invoked.ConsumePurchase( _productId );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_RestorePurchases(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
System.Action _callBack = translator.GetDelegate<System.Action>(L, 2);
|
|
|
|
gen_to_be_invoked.RestorePurchases( _callBack );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_AnalysisSubscriptionProduct(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Purchasing.Product[] _products = (UnityEngine.Purchasing.Product[])translator.GetObject(L, 2, typeof(UnityEngine.Purchasing.Product[]));
|
|
|
|
var gen_ret = gen_to_be_invoked.AnalysisSubscriptionProduct( _products );
|
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_IsInitialized(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.IsInitialized( );
|
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetProductIdById_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
|
|
|
|
|
|
{
|
|
string _id = LuaAPI.lua_tostring(L, 1);
|
|
|
|
var gen_ret = IAPManager.GetProductIdById( _id );
|
|
LuaAPI.lua_pushstring(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_SetApplicationUsername(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _applicationUsername = LuaAPI.lua_tostring(L, 2);
|
|
|
|
gen_to_be_invoked.SetApplicationUsername( _applicationUsername );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_MoneyStrSale(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _str = LuaAPI.lua_tostring(L, 2);
|
|
float _sale = (float)LuaAPI.lua_tonumber(L, 3);
|
|
|
|
var gen_ret = gen_to_be_invoked.MoneyStrSale( _str, _sale );
|
|
LuaAPI.lua_pushstring(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_MoneySplit(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _str = LuaAPI.lua_tostring(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.MoneySplit( _str );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetLocalizedPrice(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _productId = LuaAPI.lua_tostring(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.GetLocalizedPrice( _productId );
|
|
LuaAPI.lua_pushstring(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetLocalizedIsoCurrencyCode(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _productId = LuaAPI.lua_tostring(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.GetLocalizedIsoCurrencyCode( _productId );
|
|
LuaAPI.lua_pushstring(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetLocalizedPriceAmount(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _productId = LuaAPI.lua_tostring(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.GetLocalizedPriceAmount( _productId );
|
|
LuaAPI.lua_pushnumber(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_Instance(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
translator.Push(L, IAPManager.Instance);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_initCallback(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.initCallback);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_buyCallback(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.buyCallback);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_instance(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
translator.Push(L, IAPManager.instance);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_initCallback(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.initCallback = translator.GetDelegate<System.Action<bool, UnityEngine.Purchasing.Product[], string>>(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_buyCallback(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IAPManager gen_to_be_invoked = (IAPManager)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.buyCallback = translator.GetDelegate<System.Action<bool, UnityEngine.Purchasing.Product, string>>(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_instance(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
IAPManager.instance = (IAPManager)translator.GetObject(L, 1, typeof(IAPManager));
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|