Loxodon Framework 是一个轻量级的MVVM框架,它是专门为Unity3D 游戏开发设计的。我参考了WPF和Android的MVVM设计,所以在使用上以及类和接口的命名上与他们也都非常类似,我在项目中提供了大量的示例,很容易上手,对于熟悉MVVM的朋友入门门槛会更低。在WPF中是使用XAML来配置UI的,所以数据绑定也在XAML中配置,在Unity3D中,因为考虑到性能问题以及与Unity3D中UGUI的耦合问题,我没有采用这种XML的配置方式,而是使用脚本绑定的方式。
在这个框架我提供了视图和视图模型的数据绑定、本地化、一个简单的对象容器、配置文件组件、线程工具组件、应用上下文和玩家上下文,异步线程和协程的任务组件等基本组件,同时还提供了一个UI视图的框架。所有代码都基于面向对象面向接口的思路设计,几乎所有功能都可以自定义,很多接口我提供了多种实现,用户可以自由选择来使用,一般大众化的需求只需要使用我的默认实现即可,对于有特殊需求或者想扩展其他功能的用户,也可以自己重新实现接口来满足特定需求或者扩展其他的功能。
现在,本框架的XLua插件已经发布,Docs/XLua目录下面有个插件包Loxodon.Framework.XLua,安装之后,就可以完全使用Lua来开发游戏,安装步骤请看Docs/XLua/Readme 文件。
下载地址:
Asset Store (Unity3D AssetStore)
cocowolf/loxodon-framework (github)
技术支持QQ群: 622321589
使用 MIT 协议:
该软件及其相关文档对所有人免费,可以任意处置,包括使用,复制,修改,合并,发表,分发,再授权,或者销售。唯一的限制是,软件中必须包含上述版 权和许可提示。
以下是我项目介绍页面:
LoxodonFramework is a lightweight MVVM(Model-View-ViewModel) framework built specifically to target Unity3D. Databinding and localization are supported.It has a very flexible extensibility.It makes your game development faster and easier.
For tutorials,examples and support,please see the project.You can also discuss the project in the Unity Forums.
The plugin is compatible with MacOSX,Windows,Linux,UWP,IOS and Android,and provides all the source code of the project.
Tested in Unity 3D on the following platforms(已测试过的平台):
PC/Mac/Linux
IOS
Android
UWP(window10)
Downloads
Key Features:
Mvvm Framework(MVVM框架);
XLua(支持XLua,可以完全使用Lua开发,需要下载Github版本)
Multiple platforms(多平台支持);
Higher Extensibility(高扩展性);
Asynchronous result and asynchronous task are supported(支持异步结果和异步任务,采用Future/Promise 设计模式);
Scheduled Executor and Multi-threading (多线程组件和定时执行器);
Messaging system support(消息系统,订阅和发布);
Preferences can be encrypted(可加密的配置文件);
Localization support(本地化支持,与Android的本地化支持类似);
Databinding support(数据绑定支持):
Field binding(Field的绑定,只支持OneTime模式,因为无法支持修改通知);
Property binding(属性绑定,支持TwoWay双向绑定,值改变自动通知);
Dictionary,list and array binding(普通的字典、列表绑定,不支持改变通知);
Event binding(事件绑定);
Unity3d's EventBase binding(Unity3d的事件绑定);
Static property and field binding(静态类的属性和field的绑定);
Method binding(方法绑定);
Command binding(命令绑定);
ObservableProperty,ObservableDictionary and ObservableList binding(可观察属性、字典、列表的绑定,支持改变通知,数据修改自动修改UI显示);
Notes
LoxodonFramework supports .Net2.0 and .Net2.0 Subset
LoxodonFramework supports Mono2x and IL2CPP
AOT Compilation Options: "nrgctx-trampolines=8192,nimt-trampolines=8192,ntrampolines=8192" for IOS
Tutorials and Examples
Introduction
Window View
Localization
Databinding
Variable Example
ListView Binding
Contact Us
Email: yangpc.china@gmail.comWebsite:
https://cocowolf.github.io/loxodon-framework/QQ Group: 622321589