NGUI笔记1之 UICamera
2015-02-06 16:27
113 查看
UICamera作用
监听刚体组件(colliders)事件
/// * OnHover (isOver) is sent when the mouse hovers over a collider or moves away.
/// * OnPress (isDown) is sent when a mouse button gets pressed on the collider.
/// * OnSelect (selected) is sent when a mouse button is first pressed on an object. Repeated presses won't result in an OnSelect(true).
/// * OnClick () is sent when a mouse is pressed and released on the same object.
/// UICamera.currentTouchID tells you which button was clicked.
/// * OnDoubleClick () is sent when the click happens twice within a fourth of a second.
/// UICamera.currentTouchID tells you which button was clicked.
///
/// * OnDragStart () is sent to a game object under the touch just before the OnDrag() notifications begin.
/// * OnDrag (delta) is sent to an object that's being dragged.
/// * OnDragOver (draggedObject) is sent to a game object when another object is dragged over its area.
/// * OnDragOut (draggedObject) is sent to a game object when another object is dragged out of its area.
/// * OnDragEnd () is sent to a dragged object when the drag event finishes.
///
/// * OnTooltip (show) is sent when the mouse hovers over a collider for some time without moving.
/// * OnScroll (float delta) is sent out when the mouse scroll wheel is moved.
/// * OnKey (KeyCode key) is sent when keyboard or controller input is used.
例子:
监听刚体组件(colliders)事件
/// * OnHover (isOver) is sent when the mouse hovers over a collider or moves away.
/// * OnPress (isDown) is sent when a mouse button gets pressed on the collider.
/// * OnSelect (selected) is sent when a mouse button is first pressed on an object. Repeated presses won't result in an OnSelect(true).
/// * OnClick () is sent when a mouse is pressed and released on the same object.
/// UICamera.currentTouchID tells you which button was clicked.
/// * OnDoubleClick () is sent when the click happens twice within a fourth of a second.
/// UICamera.currentTouchID tells you which button was clicked.
///
/// * OnDragStart () is sent to a game object under the touch just before the OnDrag() notifications begin.
/// * OnDrag (delta) is sent to an object that's being dragged.
/// * OnDragOver (draggedObject) is sent to a game object when another object is dragged over its area.
/// * OnDragOut (draggedObject) is sent to a game object when another object is dragged out of its area.
/// * OnDragEnd () is sent to a dragged object when the drag event finishes.
///
/// * OnTooltip (show) is sent when the mouse hovers over a collider for some time without moving.
/// * OnScroll (float delta) is sent out when the mouse scroll wheel is moved.
/// * OnKey (KeyCode key) is sent when keyboard or controller input is used.
例子:
void OnPress (bool isPressed) { if (isPressed) Debug.Log("I was pressed on!"); else Debug.Log("I was unpressed"); }
相关文章推荐
- Unity + NGUI开发2D游戏的笔记。
- unity ngui anim 笔记
- Unity3D开发(七):NGUI之UICamera控制触摸,鼠标事件
- NGUI之UICamera控制触摸,鼠标事件
- unity3d中的ngui的一些笔记
- [模式识别].(希腊)西奥多里蒂斯<第四版>笔记1之__模式识别相关领域
- NGUI控件说明(中文) UICamera
- NGUI 官方文档中文版2 UICamera
- NGUI所见即所得--UICamera
- 【Unity插件】NGUI核心组件之UICamera
- NGUI UICamera属性介绍
- 【NGUI】白痴的成神之路(我自己的笔记而已)
- 【Unity3D】【NGUI】UICamera
- Unity3D中Main Camera与NGUI的UICamera小插曲
- 【Unity插件】NGUI核心组件之UICamera
- 【Unity插件】NGUI核心组件之UICamera
- 【Unity插件】NGUI核心组件之UICamera .
- NGUI -- UICamera
- NGUI 学习笔记实战——制作商城UI界面
- NGUI 学习笔记实战之二——商城数据绑定(Ndata)