少年修仙传客户端基础资源
client_Wu Xijin
2018-08-15 6c203acdb387597abd222a5a040ce94120dcecf4
更新lua脚本,添加luawindow的创建方法。
7个文件已修改
1个文件已删除
2 文件已复制
7个文件已添加
1 文件已重命名
4922 ■■■■■ 已修改文件
Assets/Editor/ScriptTemplate/LuaWindowTemplate.txt 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/ScriptTemplate/LuaWindowTemplate.txt.meta 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/CreateLuaClassFile.cs 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/CreateLuaClassFile.cs.meta 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/FileOpenEx.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/GenerateClass.cs 147 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Plugins/xlua.bundle/Contents.meta 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Plugins/xlua.bundle/Contents/MacOS.meta 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Examples/02_U3DScripting/LuaBehaviour.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/ConfigUtilWrap.cs 4267 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/ConfigUtilWrap.cs.meta 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/DelegatesGensBridge.cs 152 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/LuaBehaviourWrap.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/LuaBehaviourWrap.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/LuaWindowWrap.cs 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/LuaWindowWrap.cs.meta 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/XLuaGenAutoRegister.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/XLua/Gen/link.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/ScriptTemplate/LuaWindowTemplate.txt
New file
@@ -0,0 +1,43 @@
-- --------------------------------------------------------
--    [Author]:            第二世界
--    [  Date ]:           #DateTime#
-- --------------------------------------------------------
function BindController()
end
function AddListeners()
end
function OnPreOpen()
end
function OnAfterOpen()
end
function OnPreClose()
end
function OnAfterClose()
end
function OnActived()
end
function LateUpdate()
end
function OnDestory()
end
Assets/Editor/ScriptTemplate/LuaWindowTemplate.txt.meta
New file
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b599cad95be21124987ab773096a0bb6
timeCreated: 1505271081
licenseType: Pro
TextScriptImporter:
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/Editor/Tool/CreateLuaClassFile.cs
New file
@@ -0,0 +1,70 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor.ProjectWindowCallback;
using UnityEngine;
using UnityEditor;
using System;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
public class CreateLuaClassFile
{
    static string templatePath = "Assets/Editor/ScriptTemplate/LuaWindowTemplate.txt";
    [MenuItem("Assets/Create/Lua/LuaWindow", false, 4)]
    public static void CreateLuaClass()
    {
        var path = GetSelectedPathOrFallback() + "/NewLuaWindow.lua";
        AssetDatabase.DeleteAsset(path);
        ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance<LuaWindowTemplate>(), path, null, templatePath);
    }
    public static string GetSelectedPathOrFallback()
    {
        string path = "Assets";
        foreach (UnityEngine.Object obj in Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.Assets))
        {
            path = AssetDatabase.GetAssetPath(obj);
            if (!string.IsNullOrEmpty(path) && File.Exists(path))
            {
                path = Path.GetDirectoryName(path);
                break;
            }
        }
        return path;
    }
}
class LuaWindowTemplate : EndNameEditAction
{
    public override void Action(int instanceId, string pathName, string resourceFile)
    {
        UnityEngine.Object o = CreateScriptAssetFromTemplate(pathName, resourceFile);
        ProjectWindowUtil.ShowCreatedAsset(o);
    }
    internal static UnityEngine.Object CreateScriptAssetFromTemplate(string pathName, string resourceFile)
    {
        string fullPath = Path.GetFullPath(pathName);
        StreamReader streamReader = new StreamReader(resourceFile);
        string text = streamReader.ReadToEnd();
        streamReader.Close();
        string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(pathName);
        text = Regex.Replace(text, "#DateTime#", System.DateTime.Now.ToLongDateString());
        bool encoderShouldEmitUTF8Identifier = true;
        bool throwOnInvalidBytes = false;
        UTF8Encoding encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier, throwOnInvalidBytes);
        bool append = false;
        StreamWriter streamWriter = new StreamWriter(fullPath, append, encoding);
        streamWriter.Write(text);
        streamWriter.Close();
        AssetDatabase.ImportAsset(pathName);
        return AssetDatabase.LoadAssetAtPath(pathName, typeof(UnityEngine.Object));
    }
}
Assets/Editor/Tool/CreateLuaClassFile.cs.meta
copy from Assets/Editor/Tool/GenerateClass.cs.meta copy to Assets/Editor/Tool/CreateLuaClassFile.cs.meta
File was copied from Assets/Editor/Tool/GenerateClass.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 09e90c049827e7c47bd5e7933618748f
timeCreated: 1504661855
guid: 2aaaa063ecdf5c44da386b9e217cb493
timeCreated: 1534325353
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Assets/Editor/Tool/FileOpenEx.cs
@@ -19,7 +19,7 @@
        string path = AssetDatabase.GetAssetPath(EditorUtility.InstanceIDToObject(instanceID));
        string name = Application.dataPath + "/" + path.Replace("Assets/", "");
        if (name.EndsWith(".Shader") || name.EndsWith(".cginc") || name.EndsWith(".shader"))
        if (name.EndsWith(".Shader") || name.EndsWith(".cginc") || name.EndsWith(".shader") || name.EndsWith(".lua.txt") || name.EndsWith(".lua"))
        {
            System.Diagnostics.Process process = new System.Diagnostics.Process();
            System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
Assets/Editor/Tool/GenerateClass.cs
File was deleted
Assets/Plugins/xlua.bundle/Contents.meta
New file
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 597870007d8164f47ad635130c494e62
folderAsset: yes
timeCreated: 1534312509
licenseType: Pro
DefaultImporter:
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/Plugins/xlua.bundle/Contents/MacOS.meta
New file
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 06566e187a83c07479d6589d4394a404
folderAsset: yes
timeCreated: 1534312509
licenseType: Pro
DefaultImporter:
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/XLua/Examples/02_U3DScripting/LuaBehaviour.cs
@@ -1,12 +1,4 @@
/*
 * Tencent is pleased to support the open source community by making xLua available.
 * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
 * http://opensource.org/licenses/MIT
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
using UnityEngine;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using XLua;
@@ -23,11 +15,8 @@
[LuaCallCSharp]
public class LuaBehaviour : MonoBehaviour
{
    public TextAsset luaScript;
    public string fileName;
    public Injection[] injections;
    internal static float lastGCTime = 0;
    internal const float GCInterval = 1;//1 second
    private Action luaStart;
    private Action luaUpdate;
@@ -51,12 +40,12 @@
            scriptEnv.Set(injection.name, injection.value);
        }
        LuaUtility.env.DoString(luaScript.text, "LuaBehaviour", scriptEnv);
        LuaUtility.Do(fileName, "LuaBehaviour", scriptEnv);
        Action luaAwake = scriptEnv.Get<Action>("awake");
        scriptEnv.Get("start", out luaStart);
        scriptEnv.Get("update", out luaUpdate);
        scriptEnv.Get("ondestroy", out luaOnDestroy);
        Action luaAwake = scriptEnv.Get<Action>("Awake");
        scriptEnv.Get("Start", out luaStart);
        scriptEnv.Get("Update", out luaUpdate);
        scriptEnv.Get("OnDestroy", out luaOnDestroy);
        if (luaAwake != null)
        {
@@ -64,7 +53,6 @@
        }
    }
    // Use this for initialization
    void Start()
    {
        if (luaStart != null)
@@ -73,17 +61,11 @@
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (luaUpdate != null)
        {
            luaUpdate();
        }
        if (Time.time - LuaBehaviour.lastGCTime > GCInterval)
        {
            LuaUtility.env.Tick();
            LuaBehaviour.lastGCTime = Time.time;
        }
    }
Assets/XLua/Gen/ConfigUtilWrap.cs
New file
Diff too large
Assets/XLua/Gen/ConfigUtilWrap.cs.meta
File was renamed from Assets/Editor/Tool/GenerateClass.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 09e90c049827e7c47bd5e7933618748f
timeCreated: 1504661855
guid: 8cbe69e9bafd844418a6d146c677d315
timeCreated: 1534325202
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Assets/XLua/Gen/DelegatesGensBridge.cs
@@ -206,60 +206,7 @@
#endif
        }
        
        public void __Gen_Delegate_Imp7()
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
                RealStatePtr L = luaEnv.rawL;
                int err_func =LuaAPI.load_error_func(L, errorFuncRef);
                LuaAPI.lua_getref(L, luaReference);
                int __gen_error = LuaAPI.lua_pcall(L, 0, 0, err_func);
                if (__gen_error != 0)
                    luaEnv.ThrowExceptionFromError(err_func - 1);
                LuaAPI.lua_settop(L, err_func - 1);
#if THREAD_SAFE || HOTFIX_ENABLE
            }
#endif
        }
        public void __Gen_Delegate_Imp8(bool p0)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
                RealStatePtr L = luaEnv.rawL;
                int err_func =LuaAPI.load_error_func(L, errorFuncRef);
                LuaAPI.lua_getref(L, luaReference);
                LuaAPI.lua_pushboolean(L, p0);
                int __gen_error = LuaAPI.lua_pcall(L, 1, 0, err_func);
                if (__gen_error != 0)
                    luaEnv.ThrowExceptionFromError(err_func - 1);
                LuaAPI.lua_settop(L, err_func - 1);
#if THREAD_SAFE || HOTFIX_ENABLE
            }
#endif
        }
        public int __Gen_Delegate_Imp9(HotfixCalc p0, int p1, out double p2, ref string p3)
        public int __Gen_Delegate_Imp7(HotfixCalc p0, int p1, out double p2, ref string p3)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -290,7 +237,33 @@
#endif
        }
        
        public double __Gen_Delegate_Imp10(double p0, double p1)
        public void __Gen_Delegate_Imp8()
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
                RealStatePtr L = luaEnv.rawL;
                int err_func =LuaAPI.load_error_func(L, errorFuncRef);
                LuaAPI.lua_getref(L, luaReference);
                int __gen_error = LuaAPI.lua_pcall(L, 0, 0, err_func);
                if (__gen_error != 0)
                    luaEnv.ThrowExceptionFromError(err_func - 1);
                LuaAPI.lua_settop(L, err_func - 1);
#if THREAD_SAFE || HOTFIX_ENABLE
            }
#endif
        }
        public double __Gen_Delegate_Imp9(double p0, double p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -318,7 +291,7 @@
#endif
        }
        
        public void __Gen_Delegate_Imp11(string p0)
        public void __Gen_Delegate_Imp10(string p0)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -345,7 +318,7 @@
#endif
        }
        
        public void __Gen_Delegate_Imp12(double p0)
        public void __Gen_Delegate_Imp11(double p0)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -372,7 +345,7 @@
#endif
        }
        
        public int __Gen_Delegate_Imp13(int p0, string p1, out CSCallLua.DClass p2)
        public int __Gen_Delegate_Imp12(int p0, string p1, out CSCallLua.DClass p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -401,7 +374,7 @@
#endif
        }
        
        public System.Action __Gen_Delegate_Imp14()
        public System.Action __Gen_Delegate_Imp13()
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -427,7 +400,7 @@
#endif
        }
        
        public void __Gen_Delegate_Imp15(object p0)
        public void __Gen_Delegate_Imp14(object p0)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -454,7 +427,7 @@
#endif
        }
        
        public int __Gen_Delegate_Imp16(object p0, int p1, int p2)
        public int __Gen_Delegate_Imp15(object p0, int p1, int p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -483,7 +456,7 @@
#endif
        }
        
        public UnityEngine.Vector3 __Gen_Delegate_Imp17(object p0, UnityEngine.Vector3 p1, UnityEngine.Vector3 p2)
        public UnityEngine.Vector3 __Gen_Delegate_Imp16(object p0, UnityEngine.Vector3 p1, UnityEngine.Vector3 p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -512,7 +485,7 @@
#endif
        }
        
        public int __Gen_Delegate_Imp18(object p0, int p1, out double p2, ref string p3)
        public int __Gen_Delegate_Imp17(object p0, int p1, out double p2, ref string p3)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -543,7 +516,7 @@
#endif
        }
        
        public int __Gen_Delegate_Imp19(object p0, int p1, out double p2, ref string p3, object p4)
        public int __Gen_Delegate_Imp18(object p0, int p1, out double p2, ref string p3, object p4)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -575,7 +548,7 @@
#endif
        }
        
        public void __Gen_Delegate_Imp20(object p0, int p1)
        public void __Gen_Delegate_Imp19(object p0, int p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -603,7 +576,7 @@
#endif
        }
        
        public string __Gen_Delegate_Imp21(object p0)
        public string __Gen_Delegate_Imp20(object p0)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -630,7 +603,7 @@
#endif
        }
        
        public UnityEngine.GameObject __Gen_Delegate_Imp22(StructTest p0, int p1, object p2)
        public UnityEngine.GameObject __Gen_Delegate_Imp21(StructTest p0, int p1, object p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -659,7 +632,7 @@
#endif
        }
        
        public string __Gen_Delegate_Imp23(StructTest p0)
        public string __Gen_Delegate_Imp22(StructTest p0)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -686,7 +659,7 @@
#endif
        }
        
        public void __Gen_Delegate_Imp24(StructTest p0, object p1)
        public void __Gen_Delegate_Imp23(StructTest p0, object p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -714,7 +687,7 @@
#endif
        }
        
        public int __Gen_Delegate_Imp25(object p0)
        public int __Gen_Delegate_Imp24(object p0)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -741,7 +714,7 @@
#endif
        }
        
        public void __Gen_Delegate_Imp26(object p0, object p1)
        public void __Gen_Delegate_Imp25(object p0, object p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -769,7 +742,7 @@
#endif
        }
        
        public int __Gen_Delegate_Imp27(object p0, object p1)
        public int __Gen_Delegate_Imp26(object p0, object p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -797,7 +770,7 @@
#endif
        }
        
        public void __Gen_Delegate_Imp28(object p0, object p1, int p2)
        public void __Gen_Delegate_Imp27(object p0, object p1, int p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -826,7 +799,7 @@
#endif
        }
        
        public void __Gen_Delegate_Imp29(int p0, int p1)
        public void __Gen_Delegate_Imp28(int p0, int p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -854,7 +827,7 @@
#endif
        }
        
        public void __Gen_Delegate_Imp30(object p0, int p1, int p2)
        public void __Gen_Delegate_Imp29(object p0, int p1, int p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
@@ -927,49 +900,44 @@
                return new XLuaTest.ArrayAccess(__Gen_Delegate_Imp6);
            }
        
            if (type == typeof(TestOutDelegate))
            {
                return new TestOutDelegate(__Gen_Delegate_Imp7);
            }
            if (type == typeof(System.Action))
            {
                return new System.Action(__Gen_Delegate_Imp7);
                return new System.Action(__Gen_Delegate_Imp8);
            }
        
            if (type == typeof(UnityEngine.Events.UnityAction))
            {
                return new UnityEngine.Events.UnityAction(__Gen_Delegate_Imp7);
            }
            if (type == typeof(System.Action<bool>))
            {
                return new System.Action<bool>(__Gen_Delegate_Imp8);
            }
            if (type == typeof(TestOutDelegate))
            {
                return new TestOutDelegate(__Gen_Delegate_Imp9);
                return new UnityEngine.Events.UnityAction(__Gen_Delegate_Imp8);
            }
        
            if (type == typeof(System.Func<double, double, double>))
            {
                return new System.Func<double, double, double>(__Gen_Delegate_Imp10);
                return new System.Func<double, double, double>(__Gen_Delegate_Imp9);
            }
        
            if (type == typeof(System.Action<string>))
            {
                return new System.Action<string>(__Gen_Delegate_Imp11);
                return new System.Action<string>(__Gen_Delegate_Imp10);
            }
        
            if (type == typeof(System.Action<double>))
            {
                return new System.Action<double>(__Gen_Delegate_Imp12);
                return new System.Action<double>(__Gen_Delegate_Imp11);
            }
        
            if (type == typeof(CSCallLua.FDelegate))
            {
                return new CSCallLua.FDelegate(__Gen_Delegate_Imp13);
                return new CSCallLua.FDelegate(__Gen_Delegate_Imp12);
            }
        
            if (type == typeof(CSCallLua.GetE))
            {
                return new CSCallLua.GetE(__Gen_Delegate_Imp14);
                return new CSCallLua.GetE(__Gen_Delegate_Imp13);
            }
        
            return null;
Assets/XLua/Gen/LuaBehaviourWrap.cs
@@ -25,10 +25,10 @@
            
            
            
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "luaScript", _g_get_luaScript);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "fileName", _g_get_fileName);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "injections", _g_get_injections);
            
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "luaScript", _s_set_luaScript);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "fileName", _s_set_fileName);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "injections", _s_set_injections);
            
            
@@ -79,13 +79,13 @@
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_luaScript(RealStatePtr L)
        static int _g_get_fileName(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
                LuaBehaviour gen_to_be_invoked = (LuaBehaviour)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.luaScript);
                LuaAPI.lua_pushstring(L, gen_to_be_invoked.fileName);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
@@ -109,13 +109,13 @@
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_luaScript(RealStatePtr L)
        static int _s_set_fileName(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
                LuaBehaviour gen_to_be_invoked = (LuaBehaviour)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.luaScript = (UnityEngine.TextAsset)translator.GetObject(L, 2, typeof(UnityEngine.TextAsset));
                gen_to_be_invoked.fileName = LuaAPI.lua_tostring(L, 2);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
Assets/XLua/Gen/LuaBehaviourWrap.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 8ca74f47db9d1d44e8c094d697f8571d
timeCreated: 1533280632
timeCreated: 1534325202
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Assets/XLua/Gen/LuaWindowWrap.cs
New file
@@ -0,0 +1,146 @@
#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 LuaWindowWrap
    {
        public static void __Register(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            System.Type type = typeof(LuaWindow);
            Utils.BeginObjectRegister(type, L, translator, 0, 0, 2, 2);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "fileName", _g_get_fileName);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "injections", _g_get_injections);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "fileName", _s_set_fileName);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "injections", _s_set_injections);
            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)
                {
                    LuaWindow gen_ret = new LuaWindow();
                    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 LuaWindow constructor!");
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_fileName(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                LuaWindow gen_to_be_invoked = (LuaWindow)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushstring(L, gen_to_be_invoked.fileName);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_injections(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                LuaWindow gen_to_be_invoked = (LuaWindow)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.injections);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_fileName(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                LuaWindow gen_to_be_invoked = (LuaWindow)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.fileName = LuaAPI.lua_tostring(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_injections(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                LuaWindow gen_to_be_invoked = (LuaWindow)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.injections = (Injection[])translator.GetObject(L, 2, typeof(Injection[]));
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 0;
        }
    }
}
Assets/XLua/Gen/LuaWindowWrap.cs.meta
copy from Assets/Editor/Tool/GenerateClass.cs.meta copy to Assets/XLua/Gen/LuaWindowWrap.cs.meta
File was copied from Assets/Editor/Tool/GenerateClass.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 09e90c049827e7c47bd5e7933618748f
timeCreated: 1504661855
guid: 947b31a3c6a69914a93291c07a8bba91
timeCreated: 1534325202
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Assets/XLua/Gen/XLuaGenAutoRegister.cs
@@ -21,6 +21,10 @@
        {
            XLua.LuaEnv.AddIniter((luaenv, translator) => {
                
                translator.DelayWrapLoader(typeof(ConfigUtil), ConfigUtilWrap.__Register);
                translator.DelayWrapLoader(typeof(LuaWindow), LuaWindowWrap.__Register);
                translator.DelayWrapLoader(typeof(LuaBehaviour), LuaBehaviourWrap.__Register);
                
                translator.DelayWrapLoader(typeof(XLuaTest.Pedding), XLuaTestPeddingWrap.__Register);
@@ -121,6 +125,8 @@
                
                translator.DelayWrapLoader(typeof(Tutorial.DrivenClassExtensions), TutorialDrivenClassExtensionsWrap.__Register);
                
                translator.AddInterfaceBridgeCreator(typeof(InvokeLua.ICalc), InvokeLuaICalcBridge.__Create);
                
                translator.AddInterfaceBridgeCreator(typeof(XLuaTest.IExchanger), XLuaTestIExchangerBridge.__Create);
Assets/XLua/Gen/link.xml
@@ -3,7 +3,9 @@
<linker>
    <assembly fullname="Assembly-CSharp">
        <type fullname="LuaBehaviour" preserve="all"/>
        <type fullname="ConfigUtil" preserve="all"/>
        <type fullname="LuaWindow" preserve="all"/>
        <type fullname="LuaBehaviour" preserve="all"/>
        <type fullname="XLuaTest.Pedding" preserve="all"/>
        <type fullname="XLuaTest.MyStruct" preserve="all"/>
        <type fullname="XLuaTest.MyEnum" preserve="all"/>
@@ -23,7 +25,6 @@
        <type fullname="Tutorial.DrivenClass+TestEnumInner" preserve="all"/>
        <type fullname="Tutorial.ICalc" preserve="all"/>
        <type fullname="Tutorial.DrivenClassExtensions" preserve="all"/>
        <type fullname="luaCallCSharpTest" preserve="all"/>
        
    </assembly>