UICamera
This script should be attached to each camera that's used to draw the objects with UI components on them. This may mean only one camera (main camera or your UI camera), or multiple cameras if you happen to have multiple viewports. Failing to attach this script simply means that objects drawn by this camera won't receive UI notifications:More...
这个脚本应该连接到每个相机,用来绘制对象与UI组件的相机。这可能意味着只有一个相机(主相机或你的UI相机),或多个摄像头如果你碰巧有多个视窗。未能将此脚本只是意味着对象受到这相机不会接收UI的通知:更多…
List of all members.所有成员的列表。
Classes | |
class | Highlighted |
class | MouseOrTouch |
Static Public Member Functions静态公共成员函数 | |
staticUICamera | FindCameraForLayer (int layer) |
Find the camera responsible for handling events on objects of the specified layer. | |
Public Attributes公共属性 | |
bool | useMouse = true |
Whether the mouse input is used. 是否使用鼠标输入。 | |
bool | useTouch = true |
Whether the touch-based input is used. 是否使用触摸屏。 | |
bool | useKeyboard = true |
Whether the keyboard events will be processed.
键盘事件是否会被处理。
| |
bool | useController = true |
Whether the joystick and controller events will be processed. 操纵杆和控制器的事件是否将会被处理。 | |
LayerMask | eventReceiverMask = -1 |
Which layers will receive events.
将接收事件的层。
| |
float | tooltipDelay = 1f |
How long of a delay to expect before showing the tooltip. 延迟多久 显示工具提示。 | |
string | scrollAxisName = "Mouse ScrollWheel" |
Name of the axis used for scrolling. 用于滚动的轴名。 | |
Static Public Attributes静态公共属性 | |
static Camera | lastCamera |
Last camera active prior to sending out the event. This will always be the camera that actually sent out the event.
相机最活跃之前发送的事件。这将总会是实际上发出事件的照相机。
| |
static RaycastHit | lastHit |
Last raycast hit prior to sending out the event. This is useful if you want detailed information about what was actually hit in your OnClick, OnHover, and other event functions.
raycast最后打击之前发送的事件。这是有益的,如果你想要关于击中的详细信息 发生在OnClick,OnHover和其他事件函数中。
| |
static Vector3 | lastTouchPosition |
Last mouse or touch position in screen coordinates prior to sending out the event. 鼠标或触摸最后在屏幕坐标发送事件最后的位置。 | |
static int | lastTouchID = -1 |
ID of the touch or mouse operation prior to sending out the event. Mouse ID is '-1' for left, '-2' for right mouse button, '-3' for middle. ID触碰或鼠标操作之前,发送事件。鼠标ID ' -1 '用于左,' -2 '为鼠标右键,‘-3’为中间。 | |
static GameObject | fallThrough |
If events don't get handled, they will be forwarded to this game object.
如果事件没有得到处理,他们将被转发到这个游戏对象。
| |
Properties属性 | |
Camera | cachedCamera [get] |
Caching is always preferable for performance. 缓存的性能总是更可取的。 | |
static GameObject | hoveredObject [get] |
The object the mouse is hovering over. Results may be somewhat odd on touch-based devices.
鼠标悬停的对象。结果可能有些奇怪的触摸设备。
| |
static GameObject | selectedObject [get, set] |
Option to manually set the selected game object. 选择手动设置选定的游戏对象。 | |
static Camera | mainCamera [get] |
Convenience function that returns the main HUD camera. 便利函数,它返回主HUD相机。 | |
staticUICamera | eventHandler [get] |
Event handler for all types of events. 对所有类型的事件事件处理程序。 |
This script should be attached to each camera that's used to draw the objects with UI components on them. This may mean only one camera (main camera or your UI camera), or multiple cameras if you happen to have multiple viewports. Failing to attach this script simply means that objects drawn by this camera won't receive UI notifications:
这个脚本应该连接到每个相机,用来绘制对象与UI组件构成的。这可能意味着只有一个相机(主相机或你的UI相机),或多个摄像头如果你碰巧有多个视窗。未能将此脚本只是意味着对象受到这相机不会接收UI的通知:
static UICamera UICamera.FindCameraForLayer | ( | int | layer | ) | [static] |
Find the camera responsible for handling events on objects of the specified layer. 找到照相机负责事件处理对象指定的层。
LayerMask UICamera.eventReceiverMask = -1 |
Which layers will receive events.
GameObject UICamera.fallThrough [static] |
If events don't get handled, they will be forwarded to this game object.
Camera UICamera.lastCamera [static] |
Last camera active prior to sending out the event. This will always be the camera that actually sent out the event.(上面已有 不再重复)
RaycastHit UICamera.lastHit[static] |
Last raycast hit prior to sending out the event. This is useful if you want detailed information about what was actually hit in your OnClick, OnHover, and other event functions.
int UICamera.lastTouchID = -1 [static] |
ID of the touch or mouse operation prior to sending out the event. Mouse ID is '-1' for left, '-2' for right mouse button, '-3' for middle.
Vector3 UICamera.lastTouchPosition [static] |
Last mouse or touch position in screen coordinates prior to sending out the event.
string UICamera.scrollAxisName = "Mouse ScrollWheel" |
Name of the axis used for scrolling.
float UICamera.tooltipDelay = 1f |
How long of a delay to expect before showing the tooltip.
bool UICamera.useController = true |
Whether the joystick and controller events will be processed.
bool UICamera.useKeyboard = true |
Whether the keyboard events will be processed.
bool UICamera.useMouse = true |
Whether the mouse input is used.
bool UICamera.useTouch = true |
Whether the touch-based input is used.
Camera UICamera.cachedCamera [get] |
Caching is always preferable for performance.
UICameraUICamera.eventHandler [static, get] |
Event handler for all types of events.
GameObject UICamera.hoveredObject [static, get] |
The object the mouse is hovering over. Results may be somewhat odd on touch-based devices.
Camera UICamera.mainCamera [static, get] |
Convenience function that returns the main HUD camera.
GameObject UICamera.selectedObject [static, get, set] |
Option to manually set the selected game object.