posts - 311, comments - 0, trackbacks - 0, articles - 0
  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

(搬运工)Unity开发之NGUI系列

Posted on 2013-10-17 19:47 点点滴滴 阅读(2230) 评论(0)  编辑 收藏 引用 所属分类: 02 编程语言

在Unity开发中收集了一些插件,收集这些插件的目的并不是我喜欢在开发中使用插件。本着喜欢的态度去收集的,就像我喜欢收集模型一样;还有一点就是通过了解插件能让我知道Unity更多的功能与应用,假设说:我想做一个RPG的手机游戏,但是不知道如何通过做出打斗的那种真实感,在Assets Store已经有这样的pack或kit,我就可以从它的代码结构,资源使用及Demo截图、文字描述中大概得知一二,再经过分析,能为我做好前期的准备工作,及项目规化。当然了收集这么多插件,有些也是因为在Assets Store上宣传特别地给力,所以想收藏过来看一看其强大之处……

相对收集插件及模型来说,我更偏向看Unity方面的书箱,读书能够让我更全面地了解unity方方面面,包括一些基础的技能。

其中与NGUI相关的一系列的插件就有如下:(还有一些未整理)image,版本也从刚开始使用的2.0到现在的3.0.1,经历这么多的版本变化,对我来说,我要使用的核心的功能还是一样“提高开发效率,减少Draw Call。”

最常用的要数NGUI、NGUI&HUD Text、StarlinkUI,其它的仅打开看了,没有应用到具体的项目中

以下是部分插件在Assets Store上的截图

image

检视面板

image

UI的MVVM模式

image

文字添加右键功能

image

PS——>Unity

image

深度管理

image

屏幕适配

image

HUD Text漂浮的文字

image

主UI库

image

我把它当作成品UI库

image

在NGUI中使用Html标签

在使用3.0的时候,在readme中的这段话让我考虑了一下是否继续提升当前的NGUI版本:

*** WARNING *** PLEASE BACK UP YOUR PROJECT BEFORE UPDATING! 3.0.0 is a major changeset. You will need to open and re-save all of your scenes and prefabs after updating! After updating, expect some things to no longer work the same way they used to. Widgets scale is no longer used as its size, so any code that you had relying on this will need to change to use 'width' and 'height'. You can also expect compile errors related to delegate usage. The following links may help you:  http://www.youtube.com/watch?v=uNSZsMnhS1o&list=UUQGZdUwzE8gmvgjomZSNFJg http://www.tasharen.com/forum/index.php?topic=11.msg27296#msg27296  3.0.0: - NEW: Changed the way widgets get batched, properly fixing all remaining Z/depth issues. - NEW: Draw calls are now automatically split up as needed (no more sandwiching issues!) - NEW: Re-designed the way widget width & height gets specified. The values are now explicit, and scale is no longer used. - NEW: NGUI will now automatically replace UITextures with Sprites when they get added to an atlas. - NEW: It's now possible to have clipped panels in 3D and not have them break when tilting the camera. - NEW: It's now possible to nest widgets. - NEW: It's now possible to have multiple widgets on the same object. - NEW: It's now possible to change the selection handles color via the NGUI menu. - NEW: UICheckbox is now a UIToggle, and you now specify a 'group' ID rather than a common root object. - NEW: Added TweenWidth and TweenHeight to tween widgets width and height properties. - NEW: You can now specify the label overflow method: shrink content, clamp content, resize height, or resize freely. - NEW: When labels are in "resize label" overflow mode, the drag handles will be greyed out. - NEW: Added a simple EventDelegate class and improved all generic components to use it. - NEW: Added a Widget Container class that can be used to easily select and move groups of widgets (think: buttons, windows). - NEW: Added the RealTime helper class that removed IgnoreTimeScale. Usage: RealTime.time, RealTime.deltaTime. - NEW: Improved the inspector look of just about every component. - NEW: UIPanel now shows a list of all of its draw calls and the widgets causing them. - NEW: Added a way to auto-normalize the depth hierarchy from the NGUI menu. - NEW: You can now hide explicit draw calls by collapsing the draw call fold-outs on the panel. - NEW: Sprite selection window now shows sprite names as well. - NEW: Atlas maker will now automatically sort the sprites, saving them in an alphabetical order. - NEW: UICamera now has a better inspector, and it automatically hides properties if it's not the main one. - FIX: CTRL+ and CTRL- now adjust all widgets under the selected object. - FIX: Labels will now again align vertically properly. - FIX: Atlas maker will now respect textures that were imported with a non-native size. - FIX: Atlas maker will no longer change so many import settings on source textures. - FIX: Make Pixel Perfect is now undoable. - FIX: You can once again rename sprites in the atlas. - DEL: Removed the long-ago deprecated UISlicedSprite, UITiledSprite, and UIFilledSprite classes and some other legacy code.

当我把原来的项目中的NGUIv2.6.4换成3.0之后有很多的Error,看着这些Error,权衡了一下与我们现在的项目(中国风跑酷)的关系,决定选择V2.7.0比较妥当。我也明白太过追求最新的版本并不是最好的,考虑到我们组的开发人员有限(目前U3D只有两名),另外我要花时间去了解新版本特性及其修改的地方(Component细微的改变),但是项目组没有预算到这部分时间,所以稳定版的才是最适合我们的。