A static class of general purpose functions used by the dialogue system. More...
Static Public Member Functions | |
static bool | IsPrefab (GameObject go) |
Determines if a GameObject reference is a non-instantiated prefab or a scene object. More... | |
static byte | HexToByte (string hex) |
Utility function to convert a hex string to byte value. More... | |
static bool | IsNumber (object o) |
Determines whether an object is a numeric type. More... | |
static int | StringToInt (string s) |
Converts a string to an int. More... | |
static float | StringToFloat (string s) |
Converts a string to a float. More... | |
static bool | StringToBool (string s) |
Converts a string to a bool. More... | |
static bool | IsStringNullOrEmptyOrWhitespace (string s) |
Determines if a string is null, empty or whitespace. More... | |
static string | GetObjectName (UnityEngine.Object o) |
Gets the name of the object, or null if the object is null. More... | |
static string | GetGameObjectName (Component c) |
Gets the name of a component's GameObject. More... | |
static string | GetFullName (GameObject go) |
Gets the full name of a GameObject, following the hierarchy down from the root. More... | |
static Transform | Select (params Transform[] args) |
Returns the first non-null argument. More... | |
static MonoBehaviour | Select (params MonoBehaviour[] args) |
Returns the first non-null argument. More... | |
static void | SendMessageToEveryone (string message) |
Sends a message to all GameObjects in the scene. More... | |
static void | SendMessageToEveryone (string message, string arg) |
Sends a message to all GameObjects in the scene. More... | |
static IEnumerator | SendMessageToEveryoneAsync (string message, int gameObjectsPerFrame) |
Sends a message to all GameObjects in the scene in batches. More... | |
static void | SetGameObjectActive (Component component, bool value) |
Sets the component's game object active or inactive. More... | |
static bool | ApproximatelyZero (float x) |
Checks if a float value is approximately zero (accounting for rounding error). More... | |
static Color | WebColor (string colorCode) |
Converts a web color string to a Color. More... | |
static string | ToWebColor (Color color) |
Converts a color of to a web color string. More... | |
static string | StripRichTextCodes (string s) |
static bool | IsClipInAnimations (Animation animation, string clipName) |
Determines whether an animation clip is in the animation list. More... | |
static GameObject | GameObjectHardFind (string str) |
Finds an in-scene GameObject even if it's inactive, as long as the inactive GameObject is a child of an active GameObject. More... | |
static GameObject | GameObjectHardFind (string str, string tag) |
static T | GetComponentAnywhere< T > (GameObject gameObject) |
Like GetComponentInChildren(), but also searches parents. More... | |
static float | GetGameObjectHeight (GameObject gameObject) |
Gets the height of the game object based on its collider. More... | |
static void | SetComponentEnabled (Component component, Toggle state) |
Sets a component's enabled state to a specified state. More... | |
static bool | IsCursorActive () |
static void | SetCursorActive (bool value) |
static bool | IsCursorVisible () |
static bool | IsCursorLocked () |
static void | ShowCursor (bool value) |
static void | LockCursor (bool value) |
static void | LoadLevel (int index) |
static void | LoadLevel (string name) |
static AsyncOperation | LoadLevelAsync (string name) |
static AsyncOperation | LoadLevelAsync (int index) |
Static Public Attributes | |
static int | maxHardFindRecursion = 256 |
Specifies how deep to recurse in GameObjectHardFind. More... | |
Properties | |
static string | loadedLevelName [get] |
A static class of general purpose functions used by the dialogue system.
|
static |
Checks if a float value is approximately zero (accounting for rounding error).
true
if the value is approximately zero. x | The float to check. |
|
static |
Finds an in-scene GameObject even if it's inactive, as long as the inactive GameObject is a child of an active GameObject.
str | Name of the GameObject. |
Based on code by cawas: http://answers.unity3d.com/questions/48252/how-to-find-inactive-gameobject.html
|
static |
|
static |
Like GetComponentInChildren(), but also searches parents.
null
if not found.gameObject | Game object to search. |
T | The component type. |
T | : | Component |
|
static |
Gets the full name of a GameObject, following the hierarchy down from the root.
go | A GameObject. |
|
static |
Gets the height of the game object based on its collider.
This only works if the game object has a CharacterController, CapsuleCollider, BoxCollider, or SphereCollider.
0
.gameObject | Game object. |
|
static |
Gets the name of a component's GameObject.
c | A component |
|
static |
Gets the name of the object, or null if the object is null.
o | The object. |
|
static |
Utility function to convert a hex string to byte value.
hex | The hex string (e.g., "f0"). |
|
static |
Determines whether an animation clip is in the animation list.
true
if the clip is in the animation list. animation | The legacy Animation component. |
clipName | The clip name. |
|
static |
|
static |
|
static |
|
static |
Determines whether an object is a numeric type.
true
if the object is a numeric type; otherwise, false
. o | The object to check. |
|
static |
Determines if a GameObject reference is a non-instantiated prefab or a scene object.
If go
is null
, active in the scene, or its parent is active in the scene, it's considered a scene object. Otherwise this method searches all scene objects for matches. If it doesn't find any matches, this is a prefab.
true
if a prefab; otherwise, false
.go | GameObject. |
|
static |
Determines if a string is null, empty or whitespace.
true
if the string null, empty or whitespace; otherwise, false
.s | The string to check. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Returns the first non-null argument.
This function replaces C#'s null-coalescing operator (??), which doesn't work with component properties because, under the hood, they're always non-null.
args | List of elements to select from. |
|
static |
Returns the first non-null argument.
This function replaces C#'s null-coalescing operator (??), which doesn't work with component properties because, under the hood, they're always non-null.
args | List of elements to select from. |
|
static |
Sends a message to all GameObjects in the scene.
message | Message. |
|
static |
Sends a message to all GameObjects in the scene.
message | Message. |
arg | Argument. |
|
static |
Sends a message to all GameObjects in the scene in batches.
message | Message. |
gameObjectsPerFrame | Number of GameObjects to handle each frame. |
|
static |
Sets a component's enabled state to a specified state.
component | Component to set. |
state | State to set the component to (true, false, or flip). |
|
static |
|
static |
Sets the component's game object active or inactive.
component | Component. |
value | The value to set. |
|
static |
|
static |
Converts a string to a bool.
false
if the string can't be parsed to a bool. s | The string. |
|
static |
Converts a string to a float.
0
if the string can't be parsed to a float. s | The string. |
|
static |
Converts a string to an int.
0
if the string can't be parsed to an int. s | The string. |
|
static |
|
static |
Converts a color of to a web color string.
color | Color. |
|
static |
Converts a web color string to a Color.
colorCode | A web RGB-format color code of the format "\#rrggbb", where rr, gg, and bb are hexadecimal values (e.g., #ff0000 for red). |
|
static |
Specifies how deep to recurse in GameObjectHardFind.
|
staticget |