C# Class UICamera, Hero.Coli

Inheritance: MonoBehaviour
Afficher le fichier Open project: CyberCRI/Hero.Coli Class Usage Examples

Méthodes publiques

Свойство 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

Свойство Type Description
CompareFunc int
GetDirection int
GetDirection int
GetDirection int
Highlight void
IsVisible bool

Méthodes publiques

Méthode 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

Méthode 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 méthode

Add this camera to the list.
public Awake ( ) : void
Résultat void

FindCameraForLayer() static public méthode

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

FixedUpdate() public méthode

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

GetTouch() static public méthode

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

IsHighlighted() static public méthode

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

Notify() static public méthode

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
Résultat void

OnApplicationQuit() public méthode

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

OnDestroy() public méthode

Remove this camera from the list.
public OnDestroy ( ) : void
Résultat void

OnGUI() public méthode

public OnGUI ( ) : void
Résultat void

ProcessMouse() public méthode

Update mouse input.
public ProcessMouse ( ) : void
Résultat void

ProcessOthers() public méthode

Process keyboard and joystick events.
public ProcessOthers ( ) : void
Résultat void

ProcessTouch() public méthode

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

ProcessTouches() public méthode

Update touch-based events.
public ProcessTouches ( ) : void
Résultat void

Raycast() static public méthode

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

RemoveTouch() static public méthode

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

ShowTooltip() public méthode

Show or hide the tooltip.
public ShowTooltip ( bool val ) : void
val bool
Résultat void

Update() public méthode

Check the input and send out appropriate events.
public Update ( ) : void
Résultat void

Property Details

allowMultiTouch public_oe property

Whether multi-touch is allowed.
public bool allowMultiTouch
Résultat bool

cancelKey0 public_oe property

public KeyCode, cancelKey0
Résultat KeyCode,

cancelKey1 public_oe property

public KeyCode, cancelKey1
Résultat 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
Résultat bool

current static_oe public_oe property

UICamera that sent out the event.
static public UICamera, current
Résultat 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
Résultat Camera

currentTouch static_oe public_oe property

Current touch, set before any event function gets called.
static public MouseOrTouch currentTouch
Résultat 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
Résultat int

debug public_oe property

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

eventReceiverMask public_oe property

Which layers will receive events.
public LayerMask eventReceiverMask
Résultat 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
Résultat 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
Résultat GameObject

horizontalAxisName public_oe property

Name of the axis used to send left and right key events.
public string horizontalAxisName
Résultat 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
Résultat GameObject

inputHasFocus static_oe public_oe property

Whether an input field currently has focus.
static public bool inputHasFocus
Résultat 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
Résultat UnityEngine.RaycastHit

lastTouchPosition static_oe public_oe property

Position of the last touch (or mouse) event.
static public Vector2 lastTouchPosition
Résultat 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
Résultat 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
Résultat 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
Résultat OnCustomInput

rangeDistance public_oe property

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

scrollAxisName public_oe property

Name of the axis used for scrolling.
public string scrollAxisName
Résultat string

showTooltips static_oe public_oe property

Whether tooltips will be shown or not.
static public bool showTooltips
Résultat 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
Résultat 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
Résultat bool

submitKey0 public_oe property

Various keys used by the camera.
public KeyCode, submitKey0
Résultat KeyCode,

submitKey1 public_oe property

public KeyCode, submitKey1
Résultat KeyCode,

tooltipDelay public_oe property

How long of a delay to expect before showing the tooltip.
public float tooltipDelay
Résultat 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
Résultat 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
Résultat float

useController public_oe property

Whether the joystick and controller events will be processed.
public bool useController
Résultat bool

useKeyboard public_oe property

Whether the keyboard events will be processed.
public bool useKeyboard
Résultat bool

useMouse public_oe property

Whether the mouse input is used.
public bool useMouse
Résultat bool

useTouch public_oe property

Whether the touch-based input is used.
public bool useTouch
Résultat bool

verticalAxisName public_oe property

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