All Projects → Tencent → Xlua

Tencent / Xlua

Licence: other
xLua is a lua programming solution for C# ( Unity, .Net, Mono) , it supports android, ios, windows, linux, osx, etc.

Programming Languages

c
50402 projects - #5 most used programming language
lua
6591 projects
HTML
75241 projects
C#
18002 projects
CMake
9771 projects
Makefile
30231 projects

Projects that are alternatives of or similar to Xlua

Unitycodes
SpringGUI是对UGUI的拓展,提供十多种UI组件用于快速开发。
Stars: ✭ 701 (-90.3%)
Mutual labels:  unity, unity3d
Com.unity.multiplayer.mlapi
A game networking framework built for the Unity Engine to abstract game networking concepts.
Stars: ✭ 781 (-89.19%)
Mutual labels:  unity, unity3d
Lunar Unity Console
High-performance Unity iOS/Android logger built with native platform UI
Stars: ✭ 628 (-91.31%)
Mutual labels:  unity, unity3d
Noiseshader
Noise shader library for Unity
Stars: ✭ 616 (-91.47%)
Mutual labels:  unity, unity3d
Softmaskforugui
UI Soft Mask is a smooth masking component for Unity UI (uGUI) elements.
Stars: ✭ 688 (-90.48%)
Mutual labels:  unity, unity3d
Unitygameframework
This is literally a game framework, based on Unity game engine. It encapsulates commonly used game modules during development, and, to a large degree, standardises the process, enhances the development speed and ensures the product quality.
Stars: ✭ 617 (-91.46%)
Mutual labels:  unity, unity3d
Ffmpegout
Video capture plugin for Unity with FFmpeg.
Stars: ✭ 700 (-90.31%)
Mutual labels:  unity, unity3d
Smrvfx
An example that shows how to pass data from a skinned mesh renderer to a visual effect graph.
Stars: ✭ 589 (-91.85%)
Mutual labels:  unity, unity3d
Hologramshader
✏️ Test of an hologram material made in Unity.
Stars: ✭ 684 (-90.53%)
Mutual labels:  unity, unity3d
Restclient
🦄 Simple HTTP and REST client for Unity based on Promises, also supports Callbacks! 🎮
Stars: ✭ 675 (-90.66%)
Mutual labels:  unity, unity3d
Dungeontemplatelibrary
🌏: Dungeon free resources (terrain & roguelike generation)
Stars: ✭ 595 (-91.76%)
Mutual labels:  unity, unity3d
Unity Preview
GitHub for Unity, the Preview!
Stars: ✭ 725 (-89.96%)
Mutual labels:  unity, unity3d
Unitymeshsimplifier
Mesh simplification for Unity.
Stars: ✭ 592 (-91.81%)
Mutual labels:  unity, unity3d
Kinobloom
Bloom effect for Unity
Stars: ✭ 704 (-90.25%)
Mutual labels:  unity, unity3d
Spritedicing
Unity extension for reusing sprite texture areas
Stars: ✭ 589 (-91.85%)
Mutual labels:  unity, unity3d
Puppettest
An experiment in procedural dance animation
Stars: ✭ 631 (-91.27%)
Mutual labels:  unity, unity3d
Unitypack
Python deserialization library for Unity3D Asset format
Stars: ✭ 574 (-92.05%)
Mutual labels:  unity, unity3d
Ecs
LeoECS is a fast Entity Component System (ECS) Framework powered by C# with optional integration to Unity
Stars: ✭ 578 (-92%)
Mutual labels:  unity, unity3d
Assetstudio
AssetStudio is a tool for exploring, extracting and exporting assets and assetbundles.
Stars: ✭ 7,191 (-0.46%)
Mutual labels:  unity, unity3d
Mybox
MyBox is a set of attributes, tools and extensions for Unity
Stars: ✭ 694 (-90.39%)
Mutual labels:  unity, unity3d

license release PRs Welcome Build status

(English Documents Available)

C#下Lua编程支持

xLua为Unity、 .Net、 Mono等C#环境增加Lua脚本编程的能力,借助xLua,这些Lua代码可以方便的和C#相互调用。

xLua的突破

xLua在功能、性能、易用性都有不少突破,这几方面分别最具代表性的是:

  • 可以运行时把C#实现(方法,操作符,属性,事件等等)替换成lua实现;
  • 出色的GC优化,自定义struct,枚举在Lua和C#间传递无C# gc alloc;
  • 编辑器下无需生成代码,开发更轻量;

更详细的特性、平台支持介绍请看这里

安装

打开zip包,你会看到一个Assets目录,这目录就对应Unity工程的Assets目录,保持这目录结构放到你的Unity工程。

如果希望安装到其它目录,请看FAQ相关介绍。

文档

快速入门

一个完整的例子仅需3行代码:

安装好xLua,建一个MonoBehaviour拖到场景,在Start加入如下代码:

XLua.LuaEnv luaenv = new XLua.LuaEnv();
luaenv.DoString("CS.UnityEngine.Debug.Log('hello world')");
luaenv.Dispose();

1、DoString参数为string,可输入任意合法的Lua代码,本示例在lua里调用C#的UnityEngine.Debug.Log打印了个日志。

2、一个LuaEnv实例对应Lua虚拟机,出于开销的考虑,建议全局唯一。

C#主动调用lua也很简单,比如要调用lua的系统函数,推荐方式是:

  • 声明
[XLua.CSharpCallLua]
public delegate double LuaMax(double a, double b);
  • 绑定
var max = luaenv.Global.GetInPath<LuaMax>("math.max");
  • 调用
Debug.Log("max:" + max(32, 12));

建议绑定一次,重复使用。生成了代码的话,调用max是不产生gc alloc的。

热补丁

  • 侵入性小,老项目原有代码不做任何调整就可使用。
  • 运行时影响小,不打补丁基本和原有程序一样。
  • 出问题了可以用Lua来打补丁,这时才会走到lua代码逻辑;

这里是使用指南。

更多示例

技术支持

一群:612705778

二群:703073338

入群的问题:有问题该先从哪找答案

回答:FAQ

平时也要谨记这答案,90%以上问题都可以在FAQ里头找到答案。这些问题就别在群刷屏了。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].