标题: EZGUI基本操作简单介绍 [打印本页] 作者: 奔跑的小兔 时间: 2012-7-21 14:37 标题: EZGUI基本操作简单介绍 官方的GUI根本无法跟EZGUI比,无论是资源还是易用性还是速度。EZGUI基于Mesh不占DrawCall。EZGUI是自动合并Mesh成为一个物体,并且贴图自动制作Atlas。所以效率高,CPU消耗低
相比原生态GUI节省资源这就不细说了,自己可以做个对照看一下,下面就简单说一下怎么创建GUI控件以及触发事件。
一 .首先导入EZGUI unitypackage资源包
Plugins/EZ/GUI
Inside the GUI folder, are the Controls and Management folders. Controls is where you will find most of the scripts you will use to create controls. And Management contains the UIManager class which must exist in any scene that contains EZ GUI controls.
其中在 controls文件夹中包含大部分用于创建控件的脚本,而在Management文件夹中UIManager脚本则必须存在于每一个包含EZGUI控件的场景中。
二 创建一个按钮控件
1. 首先要单独建一个empty GameObject来存放UIManager.cs
2. 再创建一个empty GameObject改名为Button,然后点击 Component > EZ GUI > Controls > Button.
3.可以看到上图有四种状态,分别给予每种状态不同的图片(正常,鼠标放上,鼠标点击,离开)。