Detailed Description

Represents the result of a Physics Mode input test. These are used when a player clicks on the UI and the UI is in Physics mode or when WorldUI's are listening for input.

Public Member Functions

void SetPoint (int x, int y)
 Sets the location the mouse was at, relative to the UI. More...
 
void SetRelativePoint (float x, float y)
 Sets mouseX and mouseY from a relative 1 unit range coordinates. More...
 
bool RunClick (UIEvent uiEvent)
 Runs a click with the given UI event based on where on the UI this hit occured. More...
 
void RunMouseOver (UIEvent mouseEvent)
 Runs a mouse over event for the UI, if any, that this hit occured on. More...
 
bool FindWorldUI (Transform transform)
 Finds and sets OnWorldUI from the given transform. If successful, Success will be true. More...
 
void SetElement (Element hitElement)
 Sets the element that was clicked on. More...
 
void FindElement (RaycastHit hit)
 Attempts to find the element from the set WorldUI; if there is no WorldUI, the main UI is used. This search uses the triangle of the hit to figure out exactly which element was clicked. More...
 

Public Attributes

int MouseX
 The x location of the mouse relative to the UI from the left. More...
 
int MouseY
 The y location of the mouse relative to the UI from the top. More...
 
bool ScreenMode
 True if no attempt was made to resolve the element. More...
 
WorldUI OnWorldUI
 The worldUI that was hit, if any. More...
 
Element HitElement
 The element that was hit, if any. More...
 

Properties

bool Success [get]
 True if this hit was successful. More...
 
bool InWorld [get]
 True if this hit was on a WorldUI. More...
 

Private Attributes

bool Successful
 True if this hit was successful. More...
 

Member Function Documentation

void PowerUI.HitResult.FindElement ( RaycastHit  hit)
inline

Attempts to find the element from the set WorldUI; if there is no WorldUI, the main UI is used. This search uses the triangle of the hit to figure out exactly which element was clicked.

Parameters
hitThe hit in 3D that must be resolved to an element.
bool PowerUI.HitResult.FindWorldUI ( Transform  transform)
inline

Finds and sets OnWorldUI from the given transform. If successful, Success will be true.

Returns
True if successful, false otherwise.
bool PowerUI.HitResult.RunClick ( UIEvent  uiEvent)
inline

Runs a click with the given UI event based on where on the UI this hit occured.

void PowerUI.HitResult.RunMouseOver ( UIEvent  mouseEvent)
inline

Runs a mouse over event for the UI, if any, that this hit occured on.

void PowerUI.HitResult.SetElement ( Element  hitElement)
inline

Sets the element that was clicked on.

Parameters
hitElementThe element that was clicked on.
void PowerUI.HitResult.SetPoint ( int  x,
int  y 
)
inline

Sets the location the mouse was at, relative to the UI.

Parameters
xThe x coordinate of the mouse on the screen, measured from the left.
yThe y coordinate of the mouse on the screen, measured from the top.
void PowerUI.HitResult.SetRelativePoint ( float  x,
float  y 
)
inline

Sets mouseX and mouseY from a relative 1 unit range coordinates.

Parameters
xThe relative x coordinate in the range +-0.5.
yThe relative y coordinate in the range +-0.5.

Member Data Documentation

Element PowerUI.HitResult.HitElement

The element that was hit, if any.

int PowerUI.HitResult.MouseX

The x location of the mouse relative to the UI from the left.

int PowerUI.HitResult.MouseY

The y location of the mouse relative to the UI from the top.

WorldUI PowerUI.HitResult.OnWorldUI

The worldUI that was hit, if any.

bool PowerUI.HitResult.ScreenMode

True if no attempt was made to resolve the element.

bool PowerUI.HitResult.Successful
private

True if this hit was successful.

Property Documentation

bool PowerUI.HitResult.InWorld
get

True if this hit was on a WorldUI.

bool PowerUI.HitResult.Success
get

True if this hit was successful.