UI (1) - Comparison between NGUI and UGUI

UI is an important part of a game project. Facing a project starting from scratch, the first thing to establish is which UI system to choose as the main framework.

===

Now the mainstream projects are basically NGUI and UGUI, so which one to choose. Let's do a comparison first.

Atlas processing feature comparison

	NGUI需要使用工具手动拼接图片成图集。

	UGUI开发期间可以直接使用图片作为元素,打包时会自动拼接成图集。

	图集的alpha拆分功能,NGUI可以通过增加工具类和shader来做,UGUI有自带的alpha拆分功能方便许多。

Component support feature comparison

There are many NGUI components, and the more commonly used ones are

	Localization System -- 多语言组件
	UIScrollView -- 滚动视图
	UIButton -- 按钮
	UIToggle -- 切换选择组件
	UIScrollBar -- 滚动条
	UIProcessBar -- 进度条
	UIPopupList --下拉列表菜单
	UIInput -- 输入框
	UIKeyBinding -- 快捷键绑定
	UIKeyNavigation -- 导航绑定
	UIGrid -- 排列
	UITable – 表格排列
	UIPlayAnimation -- UI动画
	UIAnchor -- 锚点
	UICamera -- UI摄像头
	UIDragXXX – 拖拽摄像头,元素,视图等
	UIFont – UI字体
	UILabel – 文字组件
	UIPanel – 绘制面板
	UIPlaySound – 声音播放
	UITexture – 贴图
	等等等等…还有很多

UGUI components are less

	Text – 文字
	Image – 贴图(图集中的元素)
	RawImage – 贴图(单张图)
	Button – 按钮
	Toggle – 切换与选择
	Slider – 大小滑动块
	Scrollbar – 滑动条
	Dropdown – 下拉框
	Input Field – 输入框
	Canvas – 画布
	Panel – 一大块元素
	Scroll View – 滑动视图
	Mask – 遮挡块

Degree of customization

	NGUI有源码,可以随时随地修改满足特殊需求
	UGUI源码c#开源,可修改,但不是那么方便,需要重新打成dll后再替换原来的

input event handling

	NGUI通过摄像头发出射线碰撞,接受输入事件,并通过碰撞顺序来处理层级。
	UGUI根据输入点的位置RaycastTarget,判断事件应该交给哪个UI元素。

Hierarchy display control

	NGUI依靠Panel depth、RenderQueue来控制层级。
	UGUI可以依靠距离摄像机的前后位置来控制层级,也可以用sort order排序设置前后顺序。

font making

	NGUI不支持dynamic font。
	UGUI支持dynamic font,可直接使用字体文件

Community maturity

	NGUI商业运营,氛围良好
	UGUI官方自运营,后台强大

performance

	NGU据很多测试网站统计,性能尚可
	UGUI同样,据很多测试网站统计,性能良好

Well, the above list is a comparison of NGUI and UGUI from several aspects.

  • From the perspective of atlas tools, NGUI has more independent options, while UGUI has more automated convenience,

  • From the perspective of component support, NGUI is more suitable for rapid prototyping, while UGUI more needs to write its own components.

  • From the bottom layer of UI can be customized, both are customizable, but NGUI is more convenient.

  • From the perspective of input event processing, NGUI mixes the physical system, while UGUI has its own independent event system.

  • From the perspective of hierarchical display, the concept of NGUI is a bit confusing, while the concept of UGUI hierarchy is clear and clean.

  • From the perspective of font production, NGUI is a bit troublesome, while UGUI is more convenient.

  • From the perspective of community improvement, NGUI is more commercialized, while UGUI has a strong official support background.

  • In terms of performance, NGUI is a bit bloated but acceptable, while UGUI is better.

On the whole, both NGUI and UGUI have their own characteristics. There is no absolute good or absolute difference. Each has its own characteristics and areas of expertise. There are different options for different groups of people and projects.

How to choose the right GUI for you

Whether it is suitable or not is not absolute. It is divided according to people and projects. From the above analysis process, both NGUI and UGUI have their own characteristics, which are different for each person and each situation. My suggestion is to choose what you are familiar with, try to compare what you are not familiar with, and then make a decision.

Unity3D 4.x projects usually choose NGUI, because Unity3D 4.x does not support UGUI well. Nowadays, new projects will choose to use the latest version of Unity3D, so more UGUIs will be chosen. We need to keep pace with the times and follow the trend, so if you haven't tried UGUI, you should be familiar with UGUI sooner or later. I am determined to make a decision whether to use NGUI or UGUI. My suggestion is to enable UGUI for new projects and continue to use NGUI for old projects.

But it doesn't have to be a routine to the end. For example, some people just like to control the source code, and hope to make more custom modifications on the basis of the source code, and then improve it into their own system framework to better serve the game logic, or With better performance customization, then the best choice is NGUI. However, UGUI also has open source code, but it cannot be customized at will, it is only extended and overloaded on this basis.

Guess you like

Origin blog.csdn.net/s178435865/article/details/129520829