重新编译XLua源码

作者:追风剑情 发布于:2019-1-31 21:15 分类:Lua

一、确定电脑安装了CMake 安装CMake 安装ninja 二、下载XLua源码 https://github.com/Tencent/xLua 三、重新编译对应平台的xlua windows平台: make_win64_lua53.bat 修改下这个批处理 mkdir build64 &...

阅读全文>>

标签: xLua

评论(0) 浏览(5620)

xLua——配置项目

作者:追风剑情 发布于:2019-1-13 12:12 分类:Lua

一、拷贝下面目录到工程中 Assets\Plugins Assets\XLua\Resources Assets\XLua\Src 二、实现GenConfig接口 using System; using System.Collections; using System.Collections.Generic; using UnityEngine; name...

阅读全文>>

标签: xLua

评论(0) 浏览(6525)

编辑模式下运行lua文件

作者:追风剑情 发布于:2018-4-10 17:43 分类:Lua

示例:导出lua语言包到一个csv文件 [MenuItem ("Tool/ExportLuaLanguage CSV")] static void ExportLuaLanguageCSV() { //加载lua文件 string luaLangFile = Application.dataPath + @"\Lua\help...

阅读全文>>

标签: xLua

评论(0) 浏览(6024)

C#调用Lua函数

作者:追风剑情 发布于:2018-3-7 16:22 分类:Lua

示例 配置CodeGenConfig.cs using UnityEngine; using System; using System.Collections; using XLua; public class CSharpCallLuaTest : MonoBehaviour { private string luascr...

阅读全文>>

标签: xLua

评论(0) 浏览(4905)

xLua——动态热更(三)

作者:追风剑情 发布于:2018-1-16 18:09 分类:Lua

示例 HotfixSystem.cs using UnityEngine; using System.Text; using System.Collections; using XLua; namespace Hotfix { [Hotfix] public class HotfixSystem : MonoBehaviour {...

阅读全文>>

标签: xLua

评论(0) 浏览(4405)

xLua——C#扩展方法与xLua泛型

作者:追风剑情 发布于:2017-7-19 21:20 分类:Lua

以下代码来自xLua demo using System; using System.IO; using System.Collections.Generic; using UnityEngine; using XLua; [LuaCallCSharp] public class Foo1Parent { } [LuaCallCSharp] publ...

阅读全文>>

标签: xLua

评论(0) 浏览(8929)

xLua——xLua协程

作者:追风剑情 发布于:2017-7-18 20:42 分类:Lua

以下xLua函数来自xLua demo中的util.lua.txt文件 -- 利用xLua协程使函数func异步执行 local function coroutine_call(func) local co = coroutine.create(func) assert(coroutine.resume(co)) end

阅读全文>>

标签: xLua

评论(0) 浏览(5329)

xLua——动态热更

作者:追风剑情 发布于:2017-7-17 21:43 分类:Lua

参考 https://github.com/Tencent/xLua/blob/master/Assets/XLua/Doc/hotfix.md 以下代码来自xLua demo using UnityEngine; using System.Collections; using XLua; [Hotfix] public class HotfixTest...

阅读全文>>

标签: xLua

评论(0) 浏览(4292)

xLua——使Lua代码可访问C#代码(打标签法)

作者:追风剑情 发布于:2017-7-17 21:02 分类:Lua

以下代码来自xLua demo using UnityEngine; using XLua; using System.Collections.Generic; using System.Collections; using System; //打上[LuaCallCSharp]标签可使Lua代码能使用Coroutine_Runner类 //该方式方便,但在il...

阅读全文>>

标签: xLua

评论(0) 浏览(3199)

xLua——使Lua代码可访问C#代码(静态配置法)

作者:追风剑情 发布于:2017-7-17 20:58 分类:Lua

以下代码来自xLua demo /// <summary> /// 使Lua代码能访问C#代码 /// xLua静态配置(建议把这个类放在Editor目录下) /// </summary> public static class CoroutineConfig { //在一个静态类里声明一个静态字段 //该字段的类型除BlackLis...

阅读全文>>

标签: xLua

评论(0) 浏览(4223)

xLua——GC优化

作者:追风剑情 发布于:2017-7-17 20:43 分类:Lua

以下代码来自xLua demo using UnityEngine; using System; using XLua; namespace XLuaTest { //(GenFlag.GCOptimize)使纯值类型(包括嵌套) 在C#与Lua之间传递时不产生GC [LuaCallCSharp(GenFlag.GCOptimize)] publ...

阅读全文>>

标签: xLua

评论(0) 浏览(5408)

xLua——Lua调用C#

作者:追风剑情 发布于:2017-7-17 20:25 分类:Lua

以下代码来自xLua demo using UnityEngine; using System.Collections; using System; using XLua; using System.Collections.Generic; namespace Tutorial { [LuaCallCSharp] public class BaseCl...

阅读全文>>

标签: xLua

评论(0) 浏览(6462)

xLua——Lua函数映射成C#的delegate或interface

作者:追风剑情 发布于:2017-7-17 19:44 分类:Lua

以下代码取自xLua demo using UnityEngine; using System.Collections; using XLua; public class InvokeLua : MonoBehaviour { [CSharpCallLua] public interface ICalc { int Add(in...

阅读全文>>

标签: xLua

评论(0) 浏览(9565)

xLua——自定义加载器

作者:追风剑情 发布于:2017-7-17 16:17 分类:Lua

以下示例代码来自xLua demo using UnityEngine; using System.Collections; using XLua; public class CustomLoader : MonoBehaviour { LuaEnv luaenv = null; // Use this for initialization voi...

阅读全文>>

标签: xLua

评论(0) 浏览(4232)

xLua——C#中调用xLua代码

作者:追风剑情 发布于:2017-7-15 18:19 分类:Lua

以下代码来自xLua demo using UnityEngine; using System.Collections; using System.Collections.Generic; using XLua; using System; public class CSCallLua : MonoBehaviour { LuaEnv luaenv = null;...

阅读全文>>

标签: xLua

评论(0) 浏览(4701)

xLua——写UI逻辑

作者:追风剑情 发布于:2017-7-15 17:28 分类:Lua

以下代码来自xLua demo,这里只是做进一步说明。 一、创建lua文件 function start() print("lua start...") -- 这里的Button是UGUI控件 self:GetComponent("Button").onClick:AddListener(function() print("clicked, you inpu...

阅读全文>>

标签: xLua

评论(0) 浏览(8165)

xLua——用lua来写MonoBehaviour

作者:追风剑情 发布于:2017-7-15 17:11 分类:Lua

以下代码来自xLua demo,这里只是进一步做下解释。 一、Lua文件 local speed = 10 function start() print("lua start...") end function update() local r = CS.UnityEngine.Vector3.up * CS.UnityEngine.Time.delta...

阅读全文>>

标签: xLua

评论(0) 浏览(6983)

xLua——快速入门

作者:追风剑情 发布于:2017-7-15 16:13 分类:Lua

using System.Collections; using System.Collections.Generic; using UnityEngine; using XLua; public class Test1 : MonoBehaviour { [XLua.CSharpCallLua] public delegate double LuaMax(dou...

阅读全文>>

标签: xLua

评论(0) 浏览(5200)

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号