Skip to content

Encapsulates LuaBehaviour, enables visual component injection in the Inspector, supports automatic Lua script reloading during debugging, and allows runtime Lua script hot updates.

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

MorizeroDev/Minity.XLuaTools

Repository files navigation

Minity.XLuaTools

Encapsulates LuaBehaviour, enables visual component injection in the Inspector, supports automatic Lua script reloading during debugging, and allows runtime Lua script hot updates.

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

Setup

This is part of the Minity framework. For the complete setup guide, please refer to: github.com/MorizeroDev/Minity

LuaBehaviour

Minity encapsulates LuaBehaviour, allowing Lua scripts to adapt to the MonoBehaviour lifecycle.

It also provides an intuitive GameObject/Component injection setup, which can be configured visually in the Inspector, reducing the need for extra C# script files and simplifying component access.

img

Additionally, it offers Event Culling, allowing you to select which MonoBehaviour events to receive as needed.

LuaAsset

LuaAsset enables Unity to recognize .lua files natively. This means you can work with code editors more conveniently without having to develop scripts in .txt or .bytes format, saving development effort.

Furthermore, LuaAsset turns .lua files into Unity assets, allowing them to be managed and distributed using Unity’s asset-based resource management systems, such as Addressables.

LuaAsset also supports automatic hot updates. When you download an update patch and load it as a LuaAsset, it will automatically replace the corresponding Lua scripts in your project, including those that are already running.

For example, if you use AssetBundles, you can apply hot patches as follows:

var path = Path.Combine(Application.streamingAssetsPath, "path/to/your/bundle.bundle");
var bundle = await AssetBundle.LoadFromFileAsync(path);
var codes = bundle.LoadAllAssets<LuaAsset>();

foreach (var code in codes)
{
	code.ApplySubstitution();
}

await bundle.UnloadAsync(true);

When in Play Mode, LuaAsset (driven by a ScriptableObject) can also respond to changes in code files and reload them automatically.

About

Encapsulates LuaBehaviour, enables visual component injection in the Inspector, supports automatic Lua script reloading during debugging, and allows runtime Lua script hot updates.

Topics

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages