游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2022|回复: 0

Unity3D???LuaFramework????(1)?????

[复制链接]

1万

主题

1万

帖子

3万

积分

论坛元老

Rank: 8Rank: 8

积分
36572
发表于 2019-2-11 17:33:50 | 显示全部楼层 |阅读模式
?/???

??????Unity3D???????????????????????????????LuaFramework???????tolua?????????????????????????????????????????????????????4??????LuaFramework????????????????lua???????????

1?????

???http://www.ulua.org/index.html??LuaFramework????Unity3D????????LuaFramework_UGUI-1.0.4.109????Unity3D 5.2??????????????????lua?????Generate All?LuaFramework???Build XXX Resources????????????

????????http://pan.baidu.com/s/1gd8fG4N???01_uLua_Windows.avi?02_SimpleFramework_UGUI_Windows.avi????????windows????????????http://doc.ulua.org/article/ngui/simpleframework_base1.html????????

????????????????????????????

image001.png
???????????????????????

2???Lua??

???????????????????????lua???????helloWorld????????????????

1?????

????????Main?????Main?????????AppFacade.Instance.StartUp()??????????????????????????????

image002.png
??Main??

2????????

??????????????????????????????????lua?????Assets\LuaFramework\Scripts\Manager\GameManager.cs??OnInitalize????????????lua?????????Main.lua?Main???

image003.png
??GameManager?lua??

3???lua??

??Assets\LuaFramework\Lua\main.lua???lua??????????LuaFramework.Util.Log("HelloWorld");??????????????Debug.Log("HelloWorld")?

--???????????lua??

  1. --???????????lua??
  2. function Main()
  3.     LuaFramework.Util.Log("HelloWorld");
  4. end
复制代码

LuaFramework.Util.Log("HelloWorld")??Util?c#???????lua????????Assets\LuaFramework\Editor\CustomSettings.cs???????lua?????????CustomSettings.cs??????

image004.png
CustomSettings.cs?????

?????????????API??????????????Util???????

image005.png
Util??Assets\LuaFramework\Scripts\Utility\Util.cs??????

4?????

??????LuaFramework?Build Windows Resource????????????????????????????HelloWorld?

image006.png
??????

image007.png
????

?????????????lua????????Build XXX Resource??????????Assets\LuaFramework\Scripts\ConstDefine\AppConst.cs??LuaBundleMode???false???????????AssetBundle?????????????????

image008.png
??LuaBundleMode

3???????

???????????????????????lua???????????????????????Unity3D???????????????Unity3D???????3????

image009.png
??????

???????????Unity3D???StreamingAssets??????????????????????????????????????????????????????????????windows?????

Mac OS?Windows?Application.dataPath+"/StreamingAssets";

IOS?Application.dataPath+"/Raw";

Android?jar:file://"+Application.dataPath+"!/assets/";

??????????????Android?IOS???????????????????????????????????????????????????????????????????????????1?????????????????????????????????????????????????????3???????????????????LuaFramework??????

Android?IOS?Application.persistentDataPath+"/LuaFramework"

Mac OS?Windows?c:/LuaFramework/

??????Application.dataPath+"/StreamingAssets/"

??LuaFramework?StreamingAssets????????????

????????????????????????????????????????????????

??????????????????????????files.txt?Files.txt??????????????????????md5????????????????files.txt????????????md5????????????????2??

image010.png
files.txt

LuaFramework?????????Assets\LuaFramework\Scripts\Manager\GameManager.cs?????????????????

4??????????

???????????????????????HelloWorld?

1?????

????????????????????AppConst.cs?UpdateMode???true???????2???LuaBundleMode???true??WebUrl???????????????

image011.png
AppConst???

2???????

????iis???????????StreamingAssets???????????????????????????????????????

image012.png
????????

3??????

???Lua?????HelloWorld??Hello Lpy2????Build Windows Resource??????/StreamingAssets??????????????????????????Build Windows Resource????????????????????Hello Lpy2?????????????????

image013.png
?????

????????LuaFramework???????????????????????ToLua?LuaFramework?????????????????LuaFramework???????????????

???????

?????????Unity3D??????Unity3D?????????????????????????????????????????????????????????????????????UI??????????????????????Unity3D?????????????????????????????????????????

???Unity3D?????????????????????????

image014.jpg

?????https://zhuanlan.zhihu.com/p/21386682

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-9-14 21:09

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表