少年修仙传客户端基础资源
client_Wu Xijin
2018-10-30 f6d5413e5b5d61c08e9f0d30b77c69c1b184fc60
4340 【前端】支持xlua方便IOS提审
3个文件已修改
2个文件已添加
243 ■■■■■ 已修改文件
Assets/XLua/Gen/DelegatesGensBridge.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/SnxxzUIRedpointWrap.cs 188 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/SnxxzUIRedpointWrap.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/XLuaGenAutoRegister.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/link.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/DelegatesGensBridge.cs
@@ -82,6 +82,28 @@
#endif
        }
        
        public bool __Gen_Delegate_Imp3(int p0)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
                RealStatePtr L = luaEnv.rawL;
                int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
                LuaAPI.xlua_pushinteger(L, p0);
                PCall(L, 1, 1, errFunc);
                bool __gen_ret = LuaAPI.lua_toboolean(L, errFunc + 1);
                LuaAPI.lua_settop(L, errFunc - 1);
                return  __gen_ret;
#if THREAD_SAFE || HOTFIX_ENABLE
            }
#endif
        }
        
        static DelegateBridge()
        {
@@ -111,6 +133,11 @@
                return new LuaBehaviour.generalDelegate(__Gen_Delegate_Imp2);
            }
        
            if (type == typeof(CSharpCallLua.boolReturnedValueDelegate))
            {
                return new CSharpCallLua.boolReturnedValueDelegate(__Gen_Delegate_Imp3);
            }
            return null;
        }
    }
Assets/XLua/Gen/SnxxzUIRedpointWrap.cs
New file
@@ -0,0 +1,188 @@
#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 SnxxzUIRedpointWrap
    {
        public static void __Register(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            System.Type type = typeof(Snxxz.UI.Redpoint);
            Utils.BeginObjectRegister(type, L, translator, 0, 0, 4, 2);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "id", _g_get_id);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "parent", _g_get_parent);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "state", _g_get_state);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "count", _g_get_count);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "state", _s_set_state);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "count", _s_set_count);
            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) == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    int __id = LuaAPI.xlua_tointeger(L, 2);
                    Snxxz.UI.Redpoint gen_ret = new Snxxz.UI.Redpoint(__id);
                    translator.Push(L, gen_ret);
                    return 1;
                }
                if(LuaAPI.lua_gettop(L) == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
                {
                    int __parent = LuaAPI.xlua_tointeger(L, 2);
                    int __id = LuaAPI.xlua_tointeger(L, 3);
                    Snxxz.UI.Redpoint gen_ret = new Snxxz.UI.Redpoint(__parent, __id);
                    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 Snxxz.UI.Redpoint constructor!");
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_id(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                Snxxz.UI.Redpoint gen_to_be_invoked = (Snxxz.UI.Redpoint)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.id);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_parent(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                Snxxz.UI.Redpoint gen_to_be_invoked = (Snxxz.UI.Redpoint)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.parent);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_state(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                Snxxz.UI.Redpoint gen_to_be_invoked = (Snxxz.UI.Redpoint)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.state);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_count(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                Snxxz.UI.Redpoint gen_to_be_invoked = (Snxxz.UI.Redpoint)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.count);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_state(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                Snxxz.UI.Redpoint gen_to_be_invoked = (Snxxz.UI.Redpoint)translator.FastGetCSObj(L, 1);
                RedPointState gen_value;translator.Get(L, 2, out gen_value);
                gen_to_be_invoked.state = gen_value;
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 0;
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_count(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                Snxxz.UI.Redpoint gen_to_be_invoked = (Snxxz.UI.Redpoint)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.count = LuaAPI.xlua_tointeger(L, 2);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 0;
        }
    }
}
Assets/XLua/Gen/SnxxzUIRedpointWrap.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4c5bee8be57cdf94ab189a97d5134181
timeCreated: 1540903142
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/XLua/Gen/XLuaGenAutoRegister.cs
@@ -453,6 +453,9 @@
            translator.DelayWrapLoader(typeof(RealmPracticeModel), RealmPracticeModelWrap.__Register);
        
        
            translator.DelayWrapLoader(typeof(Snxxz.UI.Redpoint), SnxxzUIRedpointWrap.__Register);
            translator.DelayWrapLoader(typeof(Snxxz.UI.RedpointCenter), SnxxzUIRedpointCenterWrap.__Register);
        
        
@@ -485,13 +488,13 @@
        
            translator.DelayWrapLoader(typeof(Snxxz.UI.SkillModel), SnxxzUISkillModelWrap.__Register);
        
            translator.DelayWrapLoader(typeof(Snxxz.UI.TalentModel), SnxxzUITalentModelWrap.__Register);
        }
        
        static void wrapInit3(LuaEnv luaenv, ObjectTranslator translator)
        {
            translator.DelayWrapLoader(typeof(Snxxz.UI.TalentModel), SnxxzUITalentModelWrap.__Register);
        
            translator.DelayWrapLoader(typeof(CoroutineMgr), CoroutineMgrWrap.__Register);
        
@@ -642,14 +645,14 @@
        
            translator.DelayWrapLoader(typeof(WorldMapSkip), WorldMapSkipWrap.__Register);
        
            translator.DelayWrapLoader(typeof(Snxxz.UI.ItemBehaviour), SnxxzUIItemBehaviourWrap.__Register);
        }
        
        static void wrapInit4(LuaEnv luaenv, ObjectTranslator translator)
        {
        
            translator.DelayWrapLoader(typeof(Snxxz.UI.ItemBehaviour), SnxxzUIItemBehaviourWrap.__Register);
            translator.DelayWrapLoader(typeof(TimeDownMgr), TimeDownMgrWrap.__Register);
        
        
Assets/XLua/Gen/link.xml
@@ -152,6 +152,7 @@
        <type fullname="PlayerDeadModel" preserve="all"/>
        <type fullname="Snxxz.UI.RankModel" preserve="all"/>
        <type fullname="RealmPracticeModel" preserve="all"/>
        <type fullname="Snxxz.UI.Redpoint" preserve="all"/>
        <type fullname="Snxxz.UI.RedpointCenter" preserve="all"/>
        <type fullname="Snxxz.UI.MagicianModel" preserve="all"/>
        <type fullname="Snxxz.UI.RoleModel" preserve="all"/>