C# Class UICamera, Hero.Coli

Inheritance: MonoBehaviour
ファイルを表示 Open project: CyberCRI/Hero.Coli Class Usage Examples

Public Properties

Property Type Description
allowMultiTouch bool
cancelKey0 KeyCode,
cancelKey1 KeyCode,
clipRaycasts bool
current UICamera,
currentCamera Camera
currentTouch MouseOrTouch
currentTouchID int
debug bool
eventReceiverMask LayerMask
fallThrough GameObject
genericEventHandler GameObject
horizontalAxisName string
hoveredObject GameObject
inputHasFocus bool
lastHit UnityEngine.RaycastHit
lastTouchPosition Vector2
mouseClickThreshold float
mouseDragThreshold float
onCustomInput OnCustomInput
rangeDistance float
scrollAxisName string
showTooltips bool
stickyPress bool
stickyTooltip bool
submitKey0 KeyCode,
submitKey1 KeyCode,
tooltipDelay float
touchClickThreshold float
touchDragThreshold float
useController bool
useKeyboard bool
useMouse bool
useTouch bool
verticalAxisName string

Private Properties

Property Type Description
CompareFunc int
GetDirection int
GetDirection int
GetDirection int
Highlight void
IsVisible bool

Public Methods

Method Description
Awake ( ) : void

Add this camera to the list.

FindCameraForLayer ( int layer ) : UICamera,

Find the camera responsible for handling events on objects of the specified layer.

FixedUpdate ( ) : void

Update the object under the mouse if we're not using touch-based input.

GetTouch ( int id ) : MouseOrTouch

Get or create a touch event.

IsHighlighted ( GameObject go ) : bool

Returns whether the widget should be currently highlighted as far as the UICamera knows.

Notify ( GameObject go, string funcName, object obj ) : void

Generic notification function. Used in place of SendMessage to shorten the code and allow for more than one receiver.

OnApplicationQuit ( ) : void

Clear the list on application quit (also when Play mode is exited)

OnDestroy ( ) : void

Remove this camera from the list.

OnGUI ( ) : void
ProcessMouse ( ) : void

Update mouse input.

ProcessOthers ( ) : void

Process keyboard and joystick events.

ProcessTouch ( bool pressed, bool unpressed ) : void

Process the events of the specified touch.

ProcessTouches ( ) : void

Update touch-based events.

Raycast ( Vector3 inPos, RaycastHit &hit ) : bool

Returns the object under the specified position.

RemoveTouch ( int id ) : void

Remove a touch event from the list.

ShowTooltip ( bool val ) : void

Show or hide the tooltip.

Update ( ) : void

Check the input and send out appropriate events.

Private Methods

Method Description
CompareFunc ( UICamera, a, UICamera, b ) : int

Static comparison function used for sorting.

GetDirection ( KeyCode, up, KeyCode, down ) : int

Using the keyboard will result in 1 or -1, depending on whether up or down keys have been pressed.

GetDirection ( KeyCode, up0, KeyCode, up1, KeyCode, down0, KeyCode, down1 ) : int

Using the keyboard will result in 1 or -1, depending on whether up or down keys have been pressed.

GetDirection ( string axis ) : int

Using the joystick to move the UI results in 1 or -1 if the threshold has been passed, mimicking up/down keys.

Highlight ( GameObject go, bool highlighted ) : void

Apply or remove highlighted (hovered) state from the specified object.

IsVisible ( RaycastHit &hit ) : bool

Helper function to check if the specified hit is visible by the panel.

Method Details

Awake() public method

Add this camera to the list.
public Awake ( ) : void
return void

FindCameraForLayer() static public method

Find the camera responsible for handling events on objects of the specified layer.
static public FindCameraForLayer ( int layer ) : UICamera,
layer int
return UICamera,

FixedUpdate() public method

Update the object under the mouse if we're not using touch-based input.
public FixedUpdate ( ) : void
return void

GetTouch() static public method

Get or create a touch event.
static public GetTouch ( int id ) : MouseOrTouch
id int
return MouseOrTouch

IsHighlighted() static public method

Returns whether the widget should be currently highlighted as far as the UICamera knows.
static public IsHighlighted ( GameObject go ) : bool
go GameObject
return bool

Notify() static public method

Generic notification function. Used in place of SendMessage to shorten the code and allow for more than one receiver.
static public Notify ( GameObject go, string funcName, object obj ) : void
go GameObject
funcName string
obj object
return void

OnApplicationQuit() public method

Clear the list on application quit (also when Play mode is exited)
public OnApplicationQuit ( ) : void
return void

OnDestroy() public method

Remove this camera from the list.
public OnDestroy ( ) : void
return void

OnGUI() public method

public OnGUI ( ) : void
return void

ProcessMouse() public method

Update mouse input.
public ProcessMouse ( ) : void
return void

ProcessOthers() public method

Process keyboard and joystick events.
public ProcessOthers ( ) : void
return void

ProcessTouch() public method

Process the events of the specified touch.
public ProcessTouch ( bool pressed, bool unpressed ) : void
pressed bool
unpressed bool
return void

ProcessTouches() public method

Update touch-based events.
public ProcessTouches ( ) : void
return void

Raycast() static public method

Returns the object under the specified position.
static public Raycast ( Vector3 inPos, RaycastHit &hit ) : bool
inPos Vector3
hit UnityEngine.RaycastHit
return bool

RemoveTouch() static public method

Remove a touch event from the list.
static public RemoveTouch ( int id ) : void
id int
return void

ShowTooltip() public method

Show or hide the tooltip.
public ShowTooltip ( bool val ) : void
val bool
return void

Update() public method

Check the input and send out appropriate events.
public Update ( ) : void
return void

Property Details

allowMultiTouch public_oe property

Whether multi-touch is allowed.
public bool allowMultiTouch
return bool

cancelKey0 public_oe property

public KeyCode, cancelKey0
return KeyCode,

cancelKey1 public_oe property

public KeyCode, cancelKey1
return KeyCode,

clipRaycasts public_oe property

Whether raycast events will be clipped just like widgets. This essentially means that clicking on a collider that happens to have been clipped will not produce a hit. Note that having this enabled will slightly reduce performance.
public bool clipRaycasts
return bool

current static_oe public_oe property

UICamera that sent out the event.
static public UICamera, current
return UICamera,

currentCamera static_oe public_oe property

Last camera active prior to sending out the event. This will always be the camera that actually sent out the event.
static public Camera currentCamera
return Camera

currentTouch static_oe public_oe property

Current touch, set before any event function gets called.
static public MouseOrTouch currentTouch
return MouseOrTouch

currentTouchID static_oe public_oe property

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.
static public int currentTouchID
return int

debug public_oe property

If 'true', currently hovered object will be shown in the top left corner.
public bool debug
return bool

eventReceiverMask public_oe property

Which layers will receive events.
public LayerMask eventReceiverMask
return LayerMask

fallThrough static_oe public_oe property

If events don't get handled, they will be forwarded to this game object.
static public GameObject fallThrough
return GameObject

genericEventHandler static_oe public_oe property

If set, this game object will receive all events regardless of whether they were handled or not.
static public GameObject genericEventHandler
return GameObject

horizontalAxisName public_oe property

Name of the axis used to send left and right key events.
public string horizontalAxisName
return string

hoveredObject static_oe public_oe property

The object hit by the last Raycast that was the result of a mouse or touch event.
static public GameObject hoveredObject
return GameObject

inputHasFocus static_oe public_oe property

Whether an input field currently has focus.
static public bool inputHasFocus
return bool

lastHit static_oe public_oe property

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.
static public RaycastHit,UnityEngine lastHit
return UnityEngine.RaycastHit

lastTouchPosition static_oe public_oe property

Position of the last touch (or mouse) event.
static public Vector2 lastTouchPosition
return Vector2

mouseClickThreshold public_oe property

How far the mouse is allowed to move in pixels before it's no longer considered for click events, if the click notification is based on delta.
public float mouseClickThreshold
return float

mouseDragThreshold public_oe property

How much the mouse has to be moved after pressing a button before it starts to send out drag events.
public float mouseDragThreshold
return float

onCustomInput static_oe public_oe property

Custom input processing logic, if desired. For example: WP7 touches. Use UICamera.current to get the current camera.
static public OnCustomInput onCustomInput
return OnCustomInput

rangeDistance public_oe property

Raycast range distance. By default it's as far as the camera can see.
public float rangeDistance
return float

scrollAxisName public_oe property

Name of the axis used for scrolling.
public string scrollAxisName
return string

showTooltips static_oe public_oe property

Whether tooltips will be shown or not.
static public bool showTooltips
return bool

stickyPress public_oe property

If 'true', once a press event is started on some object, that object will be the only one that will be receiving future events until the press event is finally released, regardless of where that happens. If 'false', the press event won't be locked to the original object, and other objects will be receiving OnPress(true) and OnPress(false) events as the touch enters and leaves their area.
public bool stickyPress
return bool

stickyTooltip public_oe property

Whether the tooltip will disappear as soon as the mouse moves (false) or only if the mouse moves outside of the widget's area (true).
public bool stickyTooltip
return bool

submitKey0 public_oe property

Various keys used by the camera.
public KeyCode, submitKey0
return KeyCode,

submitKey1 public_oe property

public KeyCode, submitKey1
return KeyCode,

tooltipDelay public_oe property

How long of a delay to expect before showing the tooltip.
public float tooltipDelay
return float

touchClickThreshold public_oe property

How far the touch is allowed to move in pixels before it's no longer considered for click events, if the click notification is based on delta.
public float touchClickThreshold
return float

touchDragThreshold public_oe property

How much the mouse has to be moved after pressing a button before it starts to send out drag events.
public float touchDragThreshold
return float

useController public_oe property

Whether the joystick and controller events will be processed.
public bool useController
return bool

useKeyboard public_oe property

Whether the keyboard events will be processed.
public bool useKeyboard
return bool

useMouse public_oe property

Whether the mouse input is used.
public bool useMouse
return bool

useTouch public_oe property

Whether the touch-based input is used.
public bool useTouch
return bool

verticalAxisName public_oe property

Name of the axis used to send up and down key events.
public string verticalAxisName
return string