Extension methods for UnityEngine.Component.
More...
|
| static string | GetPath (this Component component, string separator="/") |
| | Get the hierarchy path, used for log or GameObject.Find() with the default separator. More...
|
| |
| static int | GetIndex (this Component component) |
| | Get the component sibling index on the attaching UnityEngine.GameObject. More...
|
| |
| static Quaternion | TransformQuat (this Transform transform, Quaternion rotation) |
| | Transforms rotation from local space to world space. More...
|
| |
| static Quaternion | InverseTransformQuat (this Transform transform, Quaternion rotation) |
| | Transforms position from world space to local space, opposite of TransformQuat(). More...
|
| |
| static void | SetCentimeterDragThreshold (this EventSystem eventSystem, float centimeter=0.3f, float fallbackDpi=200f) |
| | Set the drag threshold by centimeter for different resolution. More...
|
| |
| static Vector2 | CenterToScreenPoint (this RectTransform transform) |
| | Convert the center of a specified UnityEngine.RectTransform to screen space point. More...
|
| |
| static void | SetSorting (this Component component, int order) |
| | Set the sorting order of the UI element inside a UnityEngine.Canvas. More...
|
| |
Extension methods for UnityEngine.Component.
| static string GetPath |
( |
this Component |
component, |
|
|
string |
separator = "/" |
|
) |
| |
|
static |
Get the hierarchy path, used for log or GameObject.Find() with the default separator.
- Parameters
-
| component | Component. |
| separator | Separator. |
- Returns
- The hierarchy path.
| static int GetIndex |
( |
this Component |
component | ) |
|
|
static |
Get the component sibling index on the attaching UnityEngine.GameObject.
- Parameters
-
- Returns
- The sibling index.
| static Quaternion TransformQuat |
( |
this Transform |
transform, |
|
|
Quaternion |
rotation |
|
) |
| |
|
static |
Transforms rotation from local space to world space.
- Parameters
-
| transform | Transform. |
| rotation | Local rotation. |
- Returns
- The world rotation.
| static Quaternion InverseTransformQuat |
( |
this Transform |
transform, |
|
|
Quaternion |
rotation |
|
) |
| |
|
static |
Transforms position from world space to local space, opposite of TransformQuat().
- Parameters
-
| transform | Transform. |
| rotation | World rotation. |
- Returns
- The local rotation.
| static void SetCentimeterDragThreshold |
( |
this EventSystem |
eventSystem, |
|
|
float |
centimeter = 0.3f, |
|
|
float |
fallbackDpi = 200f |
|
) |
| |
|
static |
Set the drag threshold by centimeter for different resolution.
- Parameters
-
| eventSystem | The UnityEngine.EventSystems.EventSystem. |
| centimeter | Centimeter. |
| fallbackDpi | The fallback DPI used when failed to fetch. |
| static Vector2 CenterToScreenPoint |
( |
this RectTransform |
transform | ) |
|
|
static |
Convert the center of a specified UnityEngine.RectTransform to screen space point.
- Parameters
-
- Returns
- The screen point.
| static void SetSorting |
( |
this Component |
component, |
|
|
int |
order |
|
) |
| |
|
static |
Set the sorting order of the UI element inside a UnityEngine.Canvas.
This only apply the sub canvas in a root canvas. Check to add it with UnityEngine.UI.GraphicRaycaster if not existing.
- Parameters
-
| component | Component. |
| order | Sorting order. |