Giter Club home page Giter Club logo

unlua's Introduction

LOGO

概述

UnLua是适用于UE4的一个高度优化的Lua脚本解决方案。它遵循UE4的编程模式,功能丰富且易于学习,UE4程序员可以零学习成本使用。

在UE4中使用Lua

  • 直接访问所有的UCLASS, UPROPERTY, UFUNCTION, USTRUCT, UENUM,无须胶水代码。
  • 替换蓝图中定义的实现 ( Event / Function )。
  • 处理各类事件通知 ( Replication / Animation / Input )。

更详细的功能介绍请查看功能清单

优化特性

  • UFUNCTION调用,包括持久化参数缓存、优化的参数传递、优化的非常量引用和返回值处理。
  • 访问容器类(TArray, TSet, TMap),内存布局与引擎一致,Lua Table和容器之间不需要转换。
  • 高效的结构体创建、访问、GC。
  • 支持自定义静态导出类、成员变量、成员函数、全局函数、枚举。

平台支持

  • 运行平台:Windows / Android / iOS / Linux / OSX
  • 引擎版本:Unreal Engine 4.17.x - Unreal Engine 4.26.x

注意: 4.17.x 和 4.18.x 版本需要对 Build.cs 做一些修改。

快速开始

安装

  1. 复制 Plugins 目录到你的UE工程根目录。
  2. 重新启动你的UE工程

开始UnLua之旅

注意: 如果你是一位UE4萌新,推荐使用更详细的图文版教学继续以下步骤。

  1. 新建蓝图后打开,添加接口 UnLuaInterface
  2. 在接口的 GetModule 函数中填入Lua文件路径,如 GameModes.BP_MyGameMode_C
  3. 点击菜单栏中的 Lua Template 图标生成Lua模版文件
  4. 打开 Content/Script/GameModes/BP_MyGameMode_C.lua 编写你的代码

更多示例

模块说明

  • UnLua 主要运行时模块
  • UnLuaEditor 编辑器模块,提供Lua模版生成和commandlet控制台命令
  • UnLuaDefaultParamCollector 编码模块,收集UFUNCTION的默认参数
  • UnLuaIntelliSense 编码模块,生成用于智能提示的符号信息到内部使用的IDE(即将开放),默认不启用

文档

  • 功能清单:更详细的功能列表
  • 实现原理:介绍 UnLua 的两种覆盖机制
  • 编程指南:介绍 UnLua 的主要功能和编程模式
  • API:更详细的 UnLua API 说明
  • FAQ:常见问题解答

许可证

  • UnLua根据MIT分发。

unlua's People

Contributors

xuyanghuang-tencent avatar rowechien avatar hohooho avatar michaelzdl avatar yangruihan avatar hernanzhou avatar quabqi avatar inkiu0 avatar luckscx avatar hxhb avatar kimixuchen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.