unity UI 个人学习笔记
官网教程UI Components
Tutorial & Beginner
一. Button
Properties
1.inter-actable (决定是否可交互)
2.transition(过渡)包含color tint , sprite swap , animation三种,每类具体功能尝试即可知
其中color tint中Color multiplier会将比如Pressed 和Selected的颜色混起来,(意义不明),Fade Duration就是颜色转变的速度拉
而Animation功能强大,可点击下方按钮自动生成所需Animator组件,实现如Highlighted时改变button的width
if several buttons share the same behaviour ,these button elements can share animator controllers
3.navigation(导航)
navigation is shared by many UI elements and will be covered in it’s own lesson.
4.在Canvas生成时会同时生成EventSystem ,
when event system detects a press and a release over the same button element, the event system will process a click and the On Click event will be called.
//On Click functions list 是built-in(内置)的
//plus icon & minus icon(加减号)
Associating a game object with the object field will allow the event system to find all the functions on that game object eligible to be called by the On Click event.(所以说On Click的功能是找某个“game object”上的“component”,再从component找到要的“function”)。
The function list shows all of the components on the game object, including both the built-in components and custom scripts;
After selecting the desired component a new list shows the eligible f