Giter Site home page Giter Site logo

unityhello's Introduction

UnityHello

LICENSE

Badge

Unity版hello world,演示了各种tolua相关的hello world级程序,所以取名为hello

基于 2019.4.2 f1

https://github.com/topameng/tolua

https://github.com/tinyantstudio/UIFrameWork

https://github.com/jarjin/LuaFramework_UGUI.git

https://github.com/chuxiang9007/xlsx2lua-language.git

https://github.com/mr-kelly/KSFramework.git

1:基于spriteatlas的ugui的使用,按钮2 点击下会变红色背景)

2:proto-gen-lua 基本使用,按钮1点出 messagebox, messagebox左边按钮 encode, 右边按钮decode,顺序不要反哦,proto生成文件位于Asset/Editor下,已经继承到菜单 [MenuItem("CustomEditorTool/Protobuf-Gen-Lua", false, 110)] 中,方便使用

3:string_table 本地化。 集成到菜单[MenuItem("CustomEditorTool/StringTableTool", false, 100)] ,方便使用,就是将xlsl表转lua,messagebox的按钮文字就是从 stringtable取得。

4:timer用法。按钮2 就是 timer的小例子,messagebox 左边按钮会 停止计时

5:leantween小示例:messagebox弹出动画就是leantween做的,为什么用leantween而没用dotween,是因为dotween不好导入tolua,leantween直接导就能用,所以就不纠结了。

6:ZeroBraneStudio 调试lua程序:LuaManager.cs 下 SimpleLuaClient类 的public void OnLuaFilesLoaded() 方法里,将 //OpenZbsDebugger();注释解掉,将ZeroBraneStudio 下载到 D盘根目录,按照调试步骤就可以调试了。

5: Event使用小示例:点按钮2 ,顶部会有倒计时出现

6: 添加滚动列表小例子

7: 添加 按钮文字 Gradient Shadow小示例

8: 点击 按钮3,就会跳转到另外一个场景,然后点击topbar的左边的按钮,会跳转回原场景

9: 添加UI_Lua 类图描述




关于Lua代码风格想说两句
自己之前也没接触过lua,当然也没写过。 群里大神说ios和android都有不同程度的文件名大小写敏感问题,所以为了想避免打assetbundle过程中可能出现的潜在的坑位,我们需要对代码风格做出一些约束。由于随着程序员工人数的增多,基于lua语言的特点,为了方便大家交流,故做出一些风格上的约束:
  1. UI界面prefab 名字以ui_开头,名字全小写
  2. TP打出来的atlas图集以res_atlas_开头,名字需与文件夹同名,名字全小写
  3. tolua插件相关代码模块及导出的代码风格不做修改
  4. unity相关的代码模块保持原有驼峰风格不做修改
  5. 自己所写lua文件或者说模块,文件名全小写,采用下划线隔开命名方式
  6. 自己所写lua模块中类(姑且这么说)名字全小写,采用下划线隔开命名方式
  7. 自己所写lua模块中类所属方法 名字全小写,采用下划线隔开命名方式,如果你认为此方法别人不应调用,请前置 _ 下划线
  8. 自己所写lua模块中类所属成员变量 名字全小写,采用下划线隔开命名方式,如果你认为此变量别人不应调用,请前置 _ 下划线
  9. 常量table名字全小写,采用下划线隔开命名方式,里面的常量名字 全大写,采用下划线隔开命名方式
  10. 枚举table名字全小写,采用下划线隔开命名方式,里面的枚举名字 全大写,采用下划线隔开命名方式

代码风格是为了大家更方便的交流,以及整体的整洁所以做出约定,如果有不足之处欢迎指正,约定指定后也需严格按照约定所要求的书写代码。

unityhello's People

Contributors

woshihuo12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unityhello's Issues

unity2019.4.2f1 导入后报错

hi,
我在 macos 下使用 unity3d 2019.4.2f1 导入后(使用的 master 分支)编译,报错如下:
Error: Could not load signature of DG.Tweening.ShortcutExtensions46:DOColor due to: Could not load file or assembly 'UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null type: member:(null) signature:

Assets/Game/Scripts/Util/SocialHelpManager.cs(6,7): error CS0246: The type or namespace name 'Mobcast' could not be found (are you missing a using directive or an assembly reference?)

Assets/Game/Scripts/Util/SocialHelpManager.cs(6,7): error CS0246: The type or namespace name 'Mobcast' could not be found (are you missing a using directive or an assembly reference?)

是我环境的问题吗,还是说不能在 macos 下直接用?
多谢了。

Unity 5.5.0f3打开工程有报错

其中

  1. UnityEngine.LightShadowResolution =>UnityEngine.Rendering.LightShadowResolution
  2. 有一个int转string的参数传递错误
  3. Renderer.motionVectors 此变量没有

So工程跑不起来...

Do u miss commit some files?

Assets/Game/Scripts/UI/UITextGradient.cs(6,39): error CS0246: The type or namespace name `BaseMeshEffect' could not be found. Are you missing a using directive or an assembly reference?

大哥是不是没上传全?

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.