• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

GarfieldJiang/UGFWithToLua: Simple integration of ToLua# with UnityGameFramework ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

GarfieldJiang/UGFWithToLua

开源软件地址(OpenSource Url):

https://github.com/GarfieldJiang/UGFWithToLua

开源编程语言(OpenSource Language):

C# 88.0%

开源软件介绍(OpenSource Introduction):

Integration of ToLua with Ellan Jiang's UnityGameFramework

UnityGameFramework

ToLua

  • URL: Tolua

  • Commit: ea55728d57473bcf1a36e818f9e81bb1be0a0f25

  • Modifications:

    • Exclude LuaJit for now.
    • Remove the examples.
    • Copy Unity 5.x meta files to the right locations.
    • Change path constants in CustomSettings.cs and LuaConst.cs. (See comments like // UGF)
    • Add label 'LuaScript' for lua files so that they could be built into assetbundles. (Could be done by the editor script AssetLabelEnsurer.cs.

Structure

  • Core functionality: Assets/GameFrameworkExtensions/Lua/Scripts
    • LuaComponent extends GameFrameworkComponent and provides features of loading and running Lua scripts.
    • CustomLuaLoader hacks ToLua's file reading mechanism so that asset bundles built by Game Framework will work.
  • Usage example:
    • Assets/Scripts/ProcedureXXX.cs
    • Assets/LuaScripts/XXX.lua
  • Editor helper scripts: Assets/Scripts/Editor

How to play the example

  • Download this repo, initialize the submodule, and open it in Unity (5.3 or newer).
  • Create your own AssetBundleBuilder.xml file according to Game Framework examples, especially the output directory for asset bundles.
  • When assets are imported and source files are compiled, there will be a Game menu showing in the Unity editor. Select it and click Build AssetBundles to build lua scripts into asset bundles.
  • Copy all Package assetbundles of the platform on which you're going to run the project into Assets/StreamingAssets/.
  • Run the game in the editor or build and run the game on any platform.

Notes

  • If you tick Editor resource mode on the Base Component of Game Framework, CustomLuaLoader reads the Lua files on the disk. Otherwise, the project, when launched, first loads the asset bundles that contain Lua scripts so that CustomLuaLoader gets the script contents later from the loaded (and hence cached) texts.

  • Currently .lua files will be recoginized by Unity as default assets, rather than text assets, so that you cannot load them directly from some asset bundle. So AssetBundleBuilder.cs add .bytes extension to the file names before building asset bundles and revert them afterwards.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap