A static class of general purpose functions used by the Dialogue System. More...
Static Public Member Functions | |
static void | DeprecationWarning (MonoBehaviour mb, string extraInfo=null) |
static bool | IsPrefab (GameObject go) |
Determines if a GameObject reference is a non-instantiated prefab or a scene object. | |
static byte | HexToByte (string hex) |
Utility function to convert a hex string to byte value. | |
static bool | IsNumber (object o) |
Determines whether an object is a numeric type. | |
static int | StringToInt (string s) |
Converts a string to an int. | |
static float | StringToFloat (string s) |
Converts a string to a float, culture invariant (i.e., uses '. | |
static bool | StringToBool (string s) |
Converts a string to a bool. | |
static bool | IsStringNullOrEmptyOrWhitespace (string s) |
Determines if a string is null, empty or whitespace. | |
static string | GetAllAfterSlashes (string s) |
Returns the remainder of a string after all forward slashes, or the enter string if it doesn't contain any forward slashes. | |
static string | GetObjectName (UnityEngine.Object o) |
Gets the name of the object, or null if the object is null. | |
static string | GetGameObjectName (Component c) |
Gets the name of a component's GameObject. | |
static string | GetFullName (GameObject go) |
Gets the full name of a GameObject, following the hierarchy down from the root. | |
static Transform | Select (params Transform[] args) |
Returns the first non-null argument. | |
static MonoBehaviour | Select (params MonoBehaviour[] args) |
Returns the first non-null argument. | |
static void | SendMessageToEveryone (string message) |
Sends a message to all GameObjects in the scene. | |
static void | SendMessageToEveryone (string message, string arg) |
Sends a message to all GameObjects in the scene. | |
static IEnumerator | SendMessageToEveryoneAsync (string message, int gameObjectsPerFrame) |
Sends a message to all GameObjects in the scene in batches. | |
static void | SetGameObjectActive (Component component, bool value) |
Sets the component's game object active or inactive. | |
static void | SetGameObjectActive (GameObject gameObject, bool value) |
Sets a game object active or inactive. | |
static bool | ApproximatelyZero (float x) |
Checks if a float value is approximately zero (accounting for rounding error). | |
static Color | WebColor (string colorCode) |
Converts a web color string to a Color. | |
static string | ToWebColor (Color color) |
Converts a color of to a web color string. | |
static string | StripRichTextCodes (string s) |
static string | StripTextMeshProTags (string s) |
static string | StripRPGMakerCodes (string s) |
static bool | IsClipInAnimations (Animation animation, string clipName) |
Determines whether an animation clip is in the animation list. | |
static GameObject | GameObjectHardFind (string goName) |
Finds an in-scene GameObject even if it's inactive. | |
static GameObject | GameObjectHardFind (string goName, string tag) |
Finds an in-scene GameObject matching a name and tag even if it's inactive. | |
static GameObject[] | FindGameObjectsWithTagHard (string tag) |
Finds all GameObjects with a specified tag, even inactive GameObjects. | |
static T | GetComponentAnywhere< T > (GameObject gameObject) |
Like GetComponentInChildren(), but also searches parents. | |
static float | GetGameObjectHeight (GameObject gameObject) |
Gets the height of the game object based on its collider. | |
static void | SetComponentEnabled (Component component, Toggle state) |
Sets a component's enabled state to a specified state. | |
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 string | RemoveHtml (string s) |
Removes HTML tags from a string. | |
static string | ReplaceHtmlCharacterCodes (string s) |
Selectively replaces HTML character codes (numeric character references) that articy uses. | |
Static Public Attributes | |
static Regex | TextMeshProTagsRegex |
Properties | |
static string | loadedLevelName [get] |
A static class of general purpose functions used by the Dialogue System.
|
inlinestatic |
Checks if a float value is approximately zero (accounting for rounding error).
true
if the value is approximately zero. x | The float to check. |
|
inlinestatic |
|
inlinestatic |
Finds all GameObjects with a specified tag, even inactive GameObjects.
tag | Tag. |
|
inlinestatic |
Finds an in-scene GameObject even if it's inactive.
goName | Name of the GameObject. |
|
inlinestatic |
Finds an in-scene GameObject matching a name and tag even if it's inactive.
goName | Name of the GameObject. |
tag | Tag. |
|
inlinestatic |
Returns the remainder of a string after all forward slashes, or the enter string if it doesn't contain any forward slashes.
|
inlinestatic |
Like GetComponentInChildren(), but also searches parents.
null
if not found.gameObject | Game object to search. |
T | The component type. |
T | : | Component |
|
inlinestatic |
Gets the full name of a GameObject, following the hierarchy down from the root.
go | A GameObject. |
|
inlinestatic |
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. |
|
inlinestatic |
Gets the name of a component's GameObject.
c | A component |
|
inlinestatic |
Gets the name of the object, or null if the object is null.
o | The object. |
|
inlinestatic |
Utility function to convert a hex string to byte value.
hex | The hex string (e.g., "f0"). |
|
inlinestatic |
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. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Determines whether an object is a numeric type.
true
if the object is a numeric type; otherwise, false
. o | The object to check. |
|
inlinestatic |
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. |
|
inlinestatic |
Determines if a string is null, empty or whitespace.
true
if the string null, empty or whitespace; otherwise, false
.s | The string to check. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Removes HTML tags from a string.
s | The HTML-filled string. |
|
inlinestatic |
Selectively replaces HTML character codes (numeric character references) that articy uses.
|
inlinestatic |
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. |
|
inlinestatic |
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. |
|
inlinestatic |
Sends a message to all GameObjects in the scene.
message | Message. |
|
inlinestatic |
Sends a message to all GameObjects in the scene.
message | Message. |
arg | Argument. |
|
inlinestatic |
Sends a message to all GameObjects in the scene in batches.
message | Message. |
gameObjectsPerFrame | Number of GameObjects to handle each frame. |
|
inlinestatic |
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). |
|
inlinestatic |
|
inlinestatic |
Sets the component's game object active or inactive.
component | Component. |
value | The value to set. |
|
inlinestatic |
Sets a game object active or inactive.
gameObject | GameObject. |
value | The value to set. |
|
inlinestatic |
|
inlinestatic |
Converts a string to a bool.
false
if the string can't be parsed to a bool. s | The string. |
|
inlinestatic |
Converts a string to a float, culture invariant (i.e., uses '.
' for decimal point).
0
if the string can't be parsed to a float. s | The string. |
|
inlinestatic |
Converts a string to an int.
0
if the string can't be parsed to an int. s | The string. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Converts a color of to a web color string.
color | Color. |
|
inlinestatic |
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 |
|
staticget |