In unity3d 4.6, a new UI system is added. Although there is still a gap with ngui in terms of functions and effects, ngui is a paid plug-in after all, which restricts the commercialization of games.
Next, let's take a look at the new UI System in unity3d 4.6.
As shown in, we can see that 3D objects, 2D objects, and UIS have been classified in the gameobject menu.
UI, we can seePanel,Button,Text,Image,Rawimage,Slider,Scrollbar,Toggle,Inputfield,Canvas,EventSystem.
Controls are frequently used:Button,Text,Image,Slider,Toggle,Inputfield,ScrollbarAnd container controlsPanel.
The default display effect is as follows:
The display mode of the control is different from that of ngui.
For example, button:
As shown in, it is composed of an image script and a button script.
In the button script, we can set the button display modeColortint,SpriteswapAndAnimation. They areColor change based on status,Sprite Switching Based on status,The display of Button status is controlled by the animationcontroller..
For the same event execution, you can add a script below and select a method to run the button event. All controls are like this, but some control events are followed by parameters, the visualization section will prompt.
In addition, in the new UI system, you can addShadow,Outline.
As shown in, add a component of effects.
I will not discuss other things one by one. You can download unity 4.6 from the official website.
In general, the new UI of Unity does not have much content. Currently, it is definitely not as good as ngui. You can use it as appropriate.
This article is personal and copyrighted. For more information, see http://blog.csdn.net/ml3947. My personal blog: http://www.wjfxgame.com.
Unity3d 4.6 The new UI System