182 lines
6.6 KiB
C#
182 lines
6.6 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 UnityEnginePurchasingProductMetadataWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(UnityEngine.Purchasing.ProductMetadata);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 0, 5, 0);
|
|
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "localizedPriceString", _g_get_localizedPriceString);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "localizedTitle", _g_get_localizedTitle);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "localizedDescription", _g_get_localizedDescription);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "isoCurrencyCode", _g_get_isoCurrencyCode);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "localizedPrice", _g_get_localizedPrice);
|
|
|
|
|
|
|
|
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) == 6 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 5) || LuaAPI.lua_type(L, 5) == LuaTypes.LUA_TSTRING) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 6) || translator.IsDecimal(L, 6)))
|
|
{
|
|
string _priceString = LuaAPI.lua_tostring(L, 2);
|
|
string _title = LuaAPI.lua_tostring(L, 3);
|
|
string _description = LuaAPI.lua_tostring(L, 4);
|
|
string _currencyCode = LuaAPI.lua_tostring(L, 5);
|
|
decimal _localizedPrice;translator.Get(L, 6, out _localizedPrice);
|
|
|
|
var gen_ret = new UnityEngine.Purchasing.ProductMetadata(_priceString, _title, _description, _currencyCode, _localizedPrice);
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
if(LuaAPI.lua_gettop(L) == 2 && translator.Assignable<UnityEngine.Purchasing.ProductMetadata>(L, 2))
|
|
{
|
|
UnityEngine.Purchasing.ProductMetadata _productMetadata = (UnityEngine.Purchasing.ProductMetadata)translator.GetObject(L, 2, typeof(UnityEngine.Purchasing.ProductMetadata));
|
|
|
|
var gen_ret = new UnityEngine.Purchasing.ProductMetadata(_productMetadata);
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
if(LuaAPI.lua_gettop(L) == 1)
|
|
{
|
|
|
|
var gen_ret = new UnityEngine.Purchasing.ProductMetadata();
|
|
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 UnityEngine.Purchasing.ProductMetadata constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_localizedPriceString(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.Purchasing.ProductMetadata gen_to_be_invoked = (UnityEngine.Purchasing.ProductMetadata)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.localizedPriceString);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_localizedTitle(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.Purchasing.ProductMetadata gen_to_be_invoked = (UnityEngine.Purchasing.ProductMetadata)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.localizedTitle);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_localizedDescription(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.Purchasing.ProductMetadata gen_to_be_invoked = (UnityEngine.Purchasing.ProductMetadata)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.localizedDescription);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_isoCurrencyCode(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.Purchasing.ProductMetadata gen_to_be_invoked = (UnityEngine.Purchasing.ProductMetadata)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.isoCurrencyCode);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_localizedPrice(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.Purchasing.ProductMetadata gen_to_be_invoked = (UnityEngine.Purchasing.ProductMetadata)translator.FastGetCSObj(L, 1);
|
|
translator.PushDecimal(L, gen_to_be_invoked.localizedPrice);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|