Various extension methods. More...
Static Public Member Functions | |
static string | CTToTitleCase (this string str) |
Extension method for strings. Converts a string to title case (first letter uppercase). More... | |
static string | CTReverse (this string str) |
Extension method for strings. Reverses a string. More... | |
static string | CTReplace (this string str, string oldString, string newString, System.StringComparison comp=System.StringComparison.OrdinalIgnoreCase) |
Extension method for strings. Default: case insensitive 'Replace'. More... | |
static string | CTRemoveChars (this string str, params char[] removeChars) |
Extension method for strings. Removes characters from a string More... | |
static bool | CTEquals (this string str, string toCheck, System.StringComparison comp=System.StringComparison.OrdinalIgnoreCase) |
Extension method for strings. Default: case insensitive 'Equals'. More... | |
static bool | CTContains (this string str, string toCheck, System.StringComparison comp=System.StringComparison.OrdinalIgnoreCase) |
Extension method for strings. Default: case insensitive 'Contains'. More... | |
static bool | CTContainsAny (this string str, string searchTerms, char splitChar=' ') |
Extension method for strings. Contains any given string. More... | |
static bool | CTContainsAll (this string str, string searchTerms, char splitChar=' ') |
Extension method for strings. Contains all given strings. More... | |
static string | CTRemoveNewLines (this string str, string replacement="#nl#", string newLine=null) |
Extension method for strings. Replaces new lines with a replacement string pattern. More... | |
static string | CTAddNewLines (this string str, string replacement="#nl#", string newLine=null) |
Extension method for strings. Replaces a given string pattern with new lines in a string. More... | |
static bool | CTisNumeric (this string str) |
Extension method for strings. Checks if the string is numeric. More... | |
static bool | CTIsNumeric (this string str) |
Extension method for strings. Checks if the string is numeric. More... | |
static bool | CTisInteger (this string str) |
Extension method for strings. Checks if the string is integer. More... | |
static bool | CTIsInteger (this string str) |
Extension method for strings. Checks if the string is integer. More... | |
static bool | CTisEmail (this string str) |
Extension method for strings. Checks if the string is an email address. More... | |
static bool | CTIsEmail (this string str) |
Extension method for strings. Checks if the string is an email address. More... | |
static bool | CTisWebsite (this string str) |
Extension method for strings. Checks if the string is a website address. More... | |
static bool | CTIsWebsite (this string str) |
Extension method for strings. Checks if the string is a website address. More... | |
static bool | CTisCreditcard (this string str) |
Extension method for strings. Checks if the string is a creditcard. More... | |
static bool | CTIsCreditcard (this string str) |
Extension method for strings. Checks if the string is a creditcard. More... | |
static bool | CTisIPv4 (this string str) |
Extension method for strings. Checks if the string is an IPv4 address. More... | |
static bool | CTIsIPv4 (this string str) |
Extension method for strings. Checks if the string is an IPv4 address. More... | |
static bool | CTisAlphanumeric (this string str) |
Extension method for strings. Checks if the string is alphanumeric. More... | |
static bool | CTIsAlphanumeric (this string str) |
Extension method for strings. Checks if the string is alphanumeric. More... | |
static bool | CThasLineEndings (this string str) |
Extension method for strings. Checks if the string has line endings. More... | |
static bool | CTHasLineEndings (this string str) |
Extension method for strings. Checks if the string has line endings. More... | |
static bool | CThasInvalidChars (this string str) |
Extension method for strings. Checks if the string has invalid characters. More... | |
static bool | CTHasInvalidChars (this string str) |
Extension method for strings. Checks if the string has invalid characters. More... | |
static bool | CTStartsWith (this string str, string toCheck, System.StringComparison comp=System.StringComparison.OrdinalIgnoreCase) |
Extension method for strings. Checks if the string starts with another string. More... | |
static bool | CTEndsWith (this string str, string toCheck, System.StringComparison comp=System.StringComparison.OrdinalIgnoreCase) |
Extension method for strings. Checks if the string ends with another string. More... | |
static int | CTLastIndexOf (this string str, string toCheck, System.StringComparison comp=System.StringComparison.OrdinalIgnoreCase) |
Extension method for strings. Returns the index of the last occurence of a given string. More... | |
static int | CTIndexOf (this string str, string toCheck, System.StringComparison comp=System.StringComparison.OrdinalIgnoreCase) |
Extension method for strings. Returns the index of the first occurence of a given string. More... | |
static int | CTIndexOf (this string str, string toCheck, int startIndex, System.StringComparison comp=System.StringComparison.OrdinalIgnoreCase) |
Extension method for strings. Returns the index of the first occurence of a given string. More... | |
static string | CTToBase64 (this string str, System.Text.Encoding encoding=null) |
Extension method for strings. Converts the value of a string to a Base64-string. More... | |
static string | CTFromBase64 (this string str, System.Text.Encoding encoding=null) |
Extension method for strings. Converts the value of a Base64-string to a string. More... | |
static byte[] | CTFromBase64ToByteArray (this string str) |
Extension method for strings. Converts the value of a Base64-string to a byte-array. More... | |
static string | CTToHex (this string str, bool addPrefix=false) |
Extension method for strings. Converts the value of a string to a Hex-string (with Unicode support). More... | |
static string | CTHexToString (this string hexString) |
Extension method for strings. Converts the Hex-value of a string to a string (with Unicode support). More... | |
static Color32 | CTHexToColor32 (this string hexString) |
Extension method for strings. Converts the Hex-value of a string to a Color32. More... | |
static Color | CTHexToColor (this string hexString) |
Extension method for strings. Converts the Hex-value of a string to a Color. More... | |
static byte[] | CTToByteArray (this string str, System.Text.Encoding encoding=null) |
Extension method for strings. Converts the value of a string to a byte-array. More... | |
static string | CTClearTags (this string str) |
Extension method for strings. Cleans a given text from tags. More... | |
static string | CTClearSpaces (this string str) |
Extension method for strings. Cleans a given text from multiple spaces. More... | |
static string | CTClearLineEndings (this string str) |
Extension method for strings. Cleans a given text from line endings. More... | |
static void | CTShuffle< T > (this T[] array, int seed=0) |
Extension method for arrays. Shuffles an array. More... | |
static string | CTDump< T > (this T[] array, string prefix="", string postfix="", bool appendNewLine=true, string delimiter="; ") |
Extension method for arrays. Dumps an array to a string. More... | |
static string | CTDump (this Quaternion[] array) |
Extension method for Quaternion-arrays. Dumps an array to a string. More... | |
static string | CTDump (this Vector2[] array) |
Extension method for Vector2-arrays. Dumps an array to a string. More... | |
static string | CTDump (this Vector3[] array) |
Extension method for Vector3-arrays. Dumps an array to a string. More... | |
static string | CTDump (this Vector4[] array) |
Extension method for Vector4-arrays. Dumps an array to a string. More... | |
static string[] | CTToStringArray< T > (this T[] array) |
Extension method for arrays. Generates a string array with all entries (via ToString). More... | |
static float[] | CTToFloatArray (this byte[] array, int count=0) |
Extension method for byte-arrays. Converts a byte-array to a float-array. More... | |
static byte[] | CTToByteArray (this float[] array, int count=0) |
Extension method for float-arrays. Converts a float-array to a byte-array. More... | |
static Texture2D | CTToTexture (this byte[] data, Texture2D supportTexture=null) |
Extension method for byte-arrays. Converts a byte-array to a Texture. Supported image formats: PNG and JPG. More... | |
static Sprite | CTToSprite (this byte[] data, Texture2D supportTexture=null) |
Extension method for byte-arrays. Converts a byte-array to a Sprite. Supported image formats: PNG and JPG. More... | |
static string | CTToString (this byte[] data, System.Text.Encoding encoding=null) |
Extension method for byte-arrays. Converts a byte-array to a string. More... | |
static string | CTToBase64 (this byte[] data) |
Extension method for byte-arrays. Converts a byte-array to a Base64-string. More... | |
static T[] | GetColumn< T > (this T[,] matrix, int columnNumber) |
Extension method for 2D-arrays. Returns the column of a 2D-array as array. More... | |
static T[] | GetRow< T > (this T[,] matrix, int rowNumber) |
Extension method for 2D-arrays. Returns the row of a 2D-array as array. More... | |
static void | CTShuffle< T > (this System.Collections.Generic.IList< T > list, int seed=0) |
Extension method for IList. Shuffles a List. More... | |
static string | CTDump< T > (this System.Collections.Generic.IList< T > list, string prefix="", string postfix="", bool appendNewLine=true, string delimiter="; ") |
Extension method for IList. Dumps a list to a string. More... | |
static string | CTDump (this System.Collections.Generic.IList< Quaternion > list) |
Extension method for Quaternion-IList. Dumps a list to a string. More... | |
static string | CTDump (this System.Collections.Generic.IList< Vector2 > list) |
Extension method for Vector2-IList. Dumps a list to a string. More... | |
static string | CTDump (this System.Collections.Generic.IList< Vector3 > list) |
Extension method for Vector3-IList. Dumps a list to a string. More... | |
static string | CTDump (this System.Collections.Generic.IList< Vector4 > list) |
Extension method for Vector4-IList. Dumps a list to a string. More... | |
static System.Collections.Generic.List< string > | CTToString< T > (this System.Collections.Generic.IList< T > list) |
Extension method for IList. Generates a string list with all entries (via ToString). More... | |
static string | CTDump< K, V > (this System.Collections.Generic.IDictionary< K, V > dict, string prefix="", string postfix="", bool appendNewLine=true, string delimiter="; ") |
Extension method for IDictionary. Dumps a dictionary to a string. More... | |
static void | CTAddRange< K, V > (this System.Collections.Generic.IDictionary< K, V > dict, System.Collections.Generic.IDictionary< K, V > collection) |
Extension method for IDictionary. Adds a dictionary to an existing one. More... | |
static byte[] | CTReadFully (this System.IO.Stream input) |
Extension method for Stream. Reads the full content of a Stream. More... | |
static string | CTToHexRGB (this Color32 input) |
Extension method for Color32. Converts the value of a color to a RGB Hex-string. More... | |
static string | CTToHexRGB (this Color input) |
Extension method for Color. Converts the value of a color to a RGB Hex-string. More... | |
static string | CTToHexRGBA (this Color32 input) |
Extension method for Color32. Converts the value of a color to a RGBA Hex-string. More... | |
static string | CTToHexRGBA (this Color input) |
Extension method for Color. Converts the value of a color to a RGBA Hex-string. More... | |
static Vector3 | CTVector3 (this Color32 color) |
Extension method for Color32. Convert it to a Vector3. More... | |
static Vector3 | CTVector3 (this Color color) |
Extension method for Color. Convert it to a Vector3. More... | |
static Vector4 | CTVector4 (this Color32 color) |
Extension method for Color32. Convert it to a Vector4. More... | |
static Vector4 | CTVector4 (this Color color) |
Extension method for Color. Convert it to a Vector4. More... | |
static Vector2 | CTMultiply (this Vector2 a, Vector2 b) |
Allows you to multiply two Vector2s together, something Unity sorely lacks by default. More... | |
static Vector3 | CTMultiply (this Vector3 a, Vector3 b) |
Allows you to multiply two Vector3s together, something Unity sorely lacks by default. More... | |
static Vector3 | CTFlatten (this Vector3 a) |
Returns a Vector3 with a 0 y-axis. This is useful for keeping entities oriented perpendicular to the ground. More... | |
static Quaternion | CTQuaternion (this Vector3 eulerAngle) |
Extension method for Vector3. Convert it to a Quaternion. More... | |
static Color | CTColorRGB (this Vector3 rgb, float alpha=1f) |
Extension method for Vector3. Convert it to a Color. More... | |
static Vector4 | CTMultiply (this Vector4 a, Vector4 b) |
Allows you to multiply two Vector4s together, something Unity sorely lacks by default. More... | |
static Quaternion | CTQuaternion (this Vector4 angle) |
Extension method for Vector4. Convert it to a Quaternion. More... | |
static Color | CTColorRGBA (this Vector4 rgba) |
Extension method for Vector4. Convert it to a Color. More... | |
static Vector3 | CTVector3 (this Quaternion angle) |
Extension method for Quaternion. Convert it to a Vector3. More... | |
static Vector4 | CTVector4 (this Quaternion angle) |
Extension method for Quaternion. Convert it to a Vector4. More... | |
static Vector3 | CTCorrectLossyScale (this Canvas canvas) |
Extension method for Canvas. Convert current resolution scale. More... | |
static void | CTGetLocalCorners (this RectTransform transform, Vector3[] fourCornersArray, Canvas canvas, float inset=0, bool corrected=false) |
Extension method for RectTransform. Sets the local corners of a RectTransform to a given array. More... | |
static Vector3[] | CTGetLocalCorners (this RectTransform transform, Canvas canvas, float inset=0, bool corrected=false) |
Extension method for RectTransform. Returns the local corners of a RectTransform. More... | |
static void | CTGetScreenCorners (this RectTransform transform, Vector3[] fourCornersArray, Canvas canvas, float inset=0, bool corrected=false) |
Extension method for RectTransform. Sets the world corners of a RectTransform to a given array. More... | |
static Vector3[] | CTGetScreenCorners (this RectTransform transform, Canvas canvas, float inset=0, bool corrected=false) |
Extension method for RectTransform. Returns the screen (world) corners of a RectTransform. More... | |
static Bounds | CTGetBounds (this RectTransform transform, float uiScaleFactor=1f) |
Extension method for RectTransform. Returns the bounds of a RectTransform including the children. More... | |
static void | CTSetLeft (this RectTransform transform, float value) |
Extension method for RectTransform. Sets the Left-property of a RectTransform. More... | |
static void | CTSetRight (this RectTransform transform, float value) |
Extension method for RectTransform. Sets the Right-property of a RectTransform. More... | |
static void | CTSetTop (this RectTransform transform, float value) |
Extension method for RectTransform. Sets the Top-property of a RectTransform. More... | |
static void | CTSetBottom (this RectTransform transform, float value) |
Extension method for RectTransform. Sets the Bottom-property of a RectTransform. More... | |
static float | CTGetLeft (this RectTransform transform) |
Extension method for RectTransform. Gets the Left-property of a RectTransform. More... | |
static float | CTGetRight (this RectTransform transform) |
Extension method for RectTransform. Gets the Right-property of a RectTransform. More... | |
static float | CTGetTop (this RectTransform transform) |
Extension method for RectTransform. Gets the Top-property of a RectTransform. More... | |
static float | CTGetBottom (this RectTransform transform) |
Extension method for RectTransform. Gets the Bottom-property of a RectTransform. More... | |
static Vector4 | CTGetLRTB (this RectTransform transform) |
Extension method for RectTransform. Gets the Left/Right/Top/Bottom-properties of a RectTransform. More... | |
static void | CTSetLRTB (this RectTransform transform, Vector4 lrtb) |
Extension method for RectTransform. Sets the Left/Right/Top/Bottom-properties of a RectTransform. More... | |
static System.Collections.Generic.List< GameObject > | CTFindAll (this Component component, string name, int maxDepth=0) |
Extension method for Component. Recursively searches all children of a parent Component for specific named GameObjects More... | |
static System.Collections.Generic.List< T > | CTFindAll< T > (this Component component, string name) |
Extension method for Component. Recursively searches all children of a parent Component for specific named GameObjects More... | |
static GameObject | CTFind (this MonoBehaviour mb, string name) |
Extension method for MonoBehaviour. Recursively searches all children of a parent MonoBehaviour for specific named GameObject More... | |
static T | CTFind< T > (this MonoBehaviour mb, string name) |
Extension method for MonoBehaviour. Recursively searches all children of a parent MonoBehaviour for specific named GameObject and returns a component. More... | |
static GameObject | CTFind (this GameObject go, string name) |
Extension method for GameObject. Recursively searches all children of a parent GameObject for specific named GameObject More... | |
static T | CTFind< T > (this GameObject go, string name) |
Extension method for GameObject. Recursively searches all children of a parent GameObject for specific named GameObject and returns a component. More... | |
static Bounds | CTGetBounds (this GameObject go) |
Extension method for GameObject. Returns the bounds of a GameObject including the children. More... | |
static Transform | CTFind (this Transform transform, string name) |
Extension method for Transform. Recursively searches all children of a parent transform for specific named transform More... | |
static T | CTFind< T > (this Transform transform, string name) |
Extension method for Transform. Recursively searches all children of a parent transform for specific named transform and returns a component. More... | |
static byte[] | CTToPNG (this Sprite sprite) |
Extension method for Sprite. Converts a Sprite to a PNG byte-array. More... | |
static byte[] | CTToJPG (this Sprite sprite) |
Extension method for Sprite. Converts a Sprite to a JPG byte-array. More... | |
static byte[] | CTToTGA (this Sprite sprite) |
Extension method for Sprite. Converts a Sprite to a TGA byte-array. More... | |
static byte[] | CTToEXR (this Sprite sprite) |
Extension method for Sprite. Converts a Sprite to a EXR byte-array. More... | |
static byte[] | CTToPNG (this Texture2D texture) |
Extension method for Texture. Converts a Texture to a PNG byte-array. More... | |
static byte[] | CTToJPG (this Texture2D texture) |
Extension method for Texture. Converts a Texture to a JPG byte-array. More... | |
static byte[] | CTToTGA (this Texture2D texture) |
Extension method for Texture. Converts a Texture to a TGA byte-array. More... | |
static byte[] | CTToEXR (this Texture2D texture) |
Extension method for Texture. Converts a Texture to a EXR byte-array. More... | |
static Sprite | CTToSprite (this Texture2D texture, float pixelsPerUnit=100f) |
Extension method for Texture. Converts a Texture to a Sprite. More... | |
static Texture2D | CTRotate90 (this Texture2D texture) |
Extension method for Texture. Rotates a Texture by 90 degrees. More... | |
static Texture2D | CTRotate180 (this Texture2D texture) |
Extension method for Texture. Rotates a Texture by 180 degrees. More... | |
static Texture2D | CTRotate270 (this Texture2D texture) |
Extension method for Texture. Rotates a Texture by 270 degrees. More... | |
static Texture2D | CTToTexture2D (this Texture texture) |
Extension method for Texture. Convert a Texture to a Texture2D More... | |
static Texture2D | CTToTexture2D (this WebCamTexture texture) |
Extension method for WebCamTexture. Convert a WebCamTexture to a Texture2D More... | |
static Texture2D | CTFlipHorizontal (this Texture2D texture) |
Extension method for Texture. Flips a Texture2D horizontally More... | |
static Texture2D | CTFlipVertical (this Texture2D texture) |
Extension method for Texture. Flips a Texture2D vertically More... | |
static bool | CTHasActiveClip (this AudioSource source) |
Extension method for AudioSource. Determines if an AudioSource has an active clip. More... | |
static void | CTAbort (this System.Threading.Thread thread, bool silent=true) |
Extension method for Thread. Aborts a Thread safely and optional silently More... | |
static bool | CTIsVisibleFrom (this Renderer renderer, Camera camera) |
Extension method for Renderer. Determines if the renderer is visible from a certain camera. More... | |
Detailed Description
Various extension methods.
Member Function Documentation
◆ CTAbort()
|
static |
Extension method for Thread. Aborts a Thread safely and optional silently
- Parameters
-
thread Thread to abort. silent Silently abort the Thread (optional, default: true).
◆ CTAddNewLines()
|
static |
Extension method for strings. Replaces a given string pattern with new lines in a string.
- Parameters
-
str String-instance. replacement Replacement string pattern (optional, default: "#nl#"). newLine New line string (optional, default: System.Environment.NewLine).
- Returns
- Replaced string with new lines.
◆ CTAddRange< K, V >()
|
static |
Extension method for IDictionary. Adds a dictionary to an existing one.
- Parameters
-
dict IDictionary-instance. collection Dictionary to add.
◆ CTClearLineEndings()
|
static |
Extension method for strings. Cleans a given text from line endings.
- Parameters
-
str Input to clean.
- Returns
- Clean text without line endings.
◆ CTClearSpaces()
|
static |
Extension method for strings. Cleans a given text from multiple spaces.
- Parameters
-
str Input to clean.
- Returns
- Clean text without multiple spaces.
◆ CTClearTags()
|
static |
Extension method for strings. Cleans a given text from tags.
- Parameters
-
str Input to clean.
- Returns
- Clean text without tags.
◆ CTColorRGB()
|
static |
Extension method for Vector3. Convert it to a Color.
- Parameters
-
rgb Vector3-instance to convert (RGB = xyz). alpha Alpha-value of the color (optional, default: 1).
- Returns
- Color from RGB.
◆ CTColorRGBA()
|
static |
Extension method for Vector4. Convert it to a Color.
- Parameters
-
rgba Vector4-instance to convert (RGBA = xyzw).
- Returns
- Color from RGBA.
◆ CTContains()
|
static |
Extension method for strings. Default: case insensitive 'Contains'.
- Parameters
-
str String-instance. toCheck String to check. comp StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase)
- Returns
- True if the string contains the given string.
◆ CTContainsAll()
|
static |
Extension method for strings. Contains all given strings.
- Parameters
-
str String-instance. searchTerms Search terms separated by the given split-character. splitChar Split-character (optional, default: ' ')
- Returns
- True if the string contains all parts of the given string.
◆ CTContainsAny()
|
static |
Extension method for strings. Contains any given string.
- Parameters
-
str String-instance. searchTerms Search terms separated by the given split-character. splitChar Split-character (optional, default: ' ')
- Returns
- True if the string contains any parts of the given string.
◆ CTCorrectLossyScale()
|
static |
Extension method for Canvas. Convert current resolution scale.
- Parameters
-
canvas Canvas to convert.
- Returns
- Vector3 with the correct scale.
◆ CTDump() [1/8]
|
static |
Extension method for Quaternion-arrays. Dumps an array to a string.
- Parameters
-
array Quaternion-array-instance to dump.
- Returns
- String with lines for all array entries.
◆ CTDump() [2/8]
|
static |
Extension method for Quaternion-IList. Dumps a list to a string.
- Parameters
-
list Quaternion-IList-instance to dump.
- Returns
- String with lines for all list entries.
◆ CTDump() [3/8]
|
static |
Extension method for Vector2-IList. Dumps a list to a string.
- Parameters
-
list Vector2-IList-instance to dump.
- Returns
- String with lines for all list entries.
◆ CTDump() [4/8]
|
static |
Extension method for Vector3-IList. Dumps a list to a string.
- Parameters
-
list Vector3-IList-instance to dump.
- Returns
- String with lines for all list entries.
◆ CTDump() [5/8]
|
static |
Extension method for Vector4-IList. Dumps a list to a string.
- Parameters
-
list Vector4-IList-instance to dump.
- Returns
- String with lines for all list entries.
◆ CTDump() [6/8]
|
static |
Extension method for Vector2-arrays. Dumps an array to a string.
- Parameters
-
array Vector2-array-instance to dump.
- Returns
- String with lines for all array entries.
◆ CTDump() [7/8]
|
static |
Extension method for Vector3-arrays. Dumps an array to a string.
- Parameters
-
array Vector3-array-instance to dump.
- Returns
- String with lines for all array entries.
◆ CTDump() [8/8]
|
static |
Extension method for Vector4-arrays. Dumps an array to a string.
- Parameters
-
array Vector4-array-instance to dump.
- Returns
- String with lines for all array entries.
◆ CTDump< K, V >()
|
static |
Extension method for IDictionary. Dumps a dictionary to a string.
- Parameters
-
dict IDictionary-instance to dump. prefix Prefix for every element (optional, default: empty). postfix Postfix for every element (optional, default: empty). appendNewLine Append new line, otherwise use the given delimiter (optional, default: false). delimiter Delimiter if appendNewLine is false (optional, default: "; ").
- Returns
- String with lines for all dictionary entries.
◆ CTDump< T >() [1/2]
|
static |
Extension method for IList. Dumps a list to a string.
- Parameters
-
list IList-instance to dump. prefix Prefix for every element (optional, default: empty). postfix Postfix for every element (optional, default: empty). appendNewLine Append new line, otherwise use the given delimiter (optional, default: false). delimiter Delimiter if appendNewLine is false (optional, default: "; ").
- Returns
- String with lines for all list entries.
◆ CTDump< T >() [2/2]
|
static |
Extension method for arrays. Dumps an array to a string.
- Parameters
-
array Array-instance to dump. prefix Prefix for every element (optional, default: empty). postfix Postfix for every element (optional, default: empty). appendNewLine Append new line, otherwise use the given delimiter (optional, default: false). delimiter Delimiter if appendNewLine is false (optional, default: "; ").
- Returns
- String with lines for all array entries.
◆ CTEndsWith()
|
static |
Extension method for strings. Checks if the string ends with another string.
- Parameters
-
str String-instance. toCheck String to check. comp StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase)
- Returns
- True if the string is integer.
◆ CTEquals()
|
static |
Extension method for strings. Default: case insensitive 'Equals'.
- Parameters
-
str String-instance. toCheck String to check. comp StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase)
- Returns
- True if the string contains the given string.
◆ CTFind() [1/3]
|
static |
Extension method for GameObject. Recursively searches all children of a parent GameObject for specific named GameObject
- Parameters
-
go Parent of the current children. name Name of the GameObject.
- Returns
- GameObject with the given name or null.
◆ CTFind() [2/3]
|
static |
Extension method for MonoBehaviour. Recursively searches all children of a parent MonoBehaviour for specific named GameObject
- Parameters
-
mb Parent of the current children. name Name of the GameObject.
- Returns
- GameObject with the given name or null.
◆ CTFind() [3/3]
|
static |
Extension method for Transform. Recursively searches all children of a parent transform for specific named transform
- Parameters
-
transform Parent of the current children. name Name of the transform.
- Returns
- Transform with the given name or null.
◆ CTFind< T >() [1/3]
|
static |
Extension method for GameObject. Recursively searches all children of a parent GameObject for specific named GameObject and returns a component.
- Parameters
-
go Parent of the current children. name Name of the GameObject.
- Returns
- Component with the given type or null.
◆ CTFind< T >() [2/3]
|
static |
Extension method for MonoBehaviour. Recursively searches all children of a parent MonoBehaviour for specific named GameObject and returns a component.
- Parameters
-
mb Parent of the current children. name Name of the GameObject.
- Returns
- Component with the given type or null.
◆ CTFind< T >() [3/3]
|
static |
Extension method for Transform. Recursively searches all children of a parent transform for specific named transform and returns a component.
- Parameters
-
transform Parent of the current children. name Name of the transform.
- Returns
- Component with the given type or null.
◆ CTFindAll()
|
static |
Extension method for Component. Recursively searches all children of a parent Component for specific named GameObjects
- Parameters
-
component Parent of the current children. name Name of the GameObject. maxDepth Maximal depth of the search (default 0, optional).
- Returns
- List of GameObjects with the given name or empty list.
◆ CTFindAll< T >()
|
static |
Extension method for Component. Recursively searches all children of a parent Component for specific named GameObjects
- Parameters
-
component Parent of the current children. name Name of the GameObject.
- Returns
- List of GameObjects with the given name or empty list.
- Type Constraints
-
T : Component
◆ CTFlatten()
|
static |
Returns a Vector3 with a 0 y-axis. This is useful for keeping entities oriented perpendicular to the ground.
◆ CTFlipHorizontal()
|
static |
Extension method for Texture. Flips a Texture2D horizontally
- Parameters
-
texture Texture to flip.
- Returns
- Horizontally flipped Texture2D.
◆ CTFlipVertical()
|
static |
Extension method for Texture. Flips a Texture2D vertically
- Parameters
-
texture Texture to flip.
- Returns
- Vertically flipped Texture2D.
◆ CTFromBase64()
|
static |
Extension method for strings. Converts the value of a Base64-string to a string.
- Parameters
-
str Input Base64-string. encoding Encoding of the string (optional, default: UTF8).
- Returns
- Base64-string value as converted string.
◆ CTFromBase64ToByteArray()
|
static |
Extension method for strings. Converts the value of a Base64-string to a byte-array.
- Parameters
-
str Input Base64-string.
- Returns
- Base64-Byte-array from the Base64-string.
◆ CTGetBottom()
|
static |
Extension method for RectTransform. Gets the Bottom-property of a RectTransform.
- Parameters
-
transform RectTransform to get the Bottom-property.
- Returns
- Bottom-property of the RectTransform.
◆ CTGetBounds() [1/2]
|
static |
Extension method for GameObject. Returns the bounds of a GameObject including the children.
- Parameters
-
go GameObject to calculate the bounds.
- Returns
- Bounds of the GameObject.
◆ CTGetBounds() [2/2]
|
static |
Extension method for RectTransform. Returns the bounds of a RectTransform including the children.
- Parameters
-
transform RectTransform to calculate the bounds. uiScaleFactor Scale of the UI (optional, default: 1.0).
- Returns
- Bounds of the RectTransform.
◆ CTGetLeft()
|
static |
Extension method for RectTransform. Gets the Left-property of a RectTransform.
- Parameters
-
transform RectTransform to get the Left-property.
- Returns
- Left-property of the RectTransform.
◆ CTGetLocalCorners() [1/2]
|
static |
Extension method for RectTransform. Returns the local corners of a RectTransform.
- Parameters
-
transform RectTransform-instance. canvas Relevant canvas. inset Inset from the corners (optional, default: 0). corrected Automatically adjust scaling (optional, default: false).
- Returns
- Array of the four local corners of the RectTransform.
◆ CTGetLocalCorners() [2/2]
|
static |
Extension method for RectTransform. Sets the local corners of a RectTransform to a given array.
- Parameters
-
transform RectTransform-instance. fourCornersArray Corners for the RectTransform. canvas Relevant canvas. inset Inset from the corners (optional, default: 0). corrected Automatically adjust scaling (optional, default: false).
◆ CTGetLRTB()
|
static |
Extension method for RectTransform. Gets the Left/Right/Top/Bottom-properties of a RectTransform.
- Parameters
-
transform RectTransform to get the Left/Right/Top/Bottom-properties.
- Returns
- Left/Right/Top/Bottom-properties of the RectTransform as Vector4.
◆ CTGetRight()
|
static |
Extension method for RectTransform. Gets the Right-property of a RectTransform.
- Parameters
-
transform RectTransform to get the Right-property.
- Returns
- Right-property of the RectTransform.
◆ CTGetScreenCorners() [1/2]
|
static |
Extension method for RectTransform. Returns the screen (world) corners of a RectTransform.
- Parameters
-
transform RectTransform-instance. canvas Relevant canvas. inset Inset from the corners (optional, default: 0). corrected Automatically adjust scaling (optional, default: false).
- Returns
- Array of the four screen (world) corners of the RectTransform.
◆ CTGetScreenCorners() [2/2]
|
static |
Extension method for RectTransform. Sets the world corners of a RectTransform to a given array.
- Parameters
-
transform RectTransform-instance. fourCornersArray Corners for the RectTransform. canvas Relevant canvas. inset Inset from the corners (optional, default: 0). corrected Automatically adjust scaling (optional, default: false).
◆ CTGetTop()
|
static |
Extension method for RectTransform. Gets the Top-property of a RectTransform.
- Parameters
-
transform RectTransform to get the Top-property.
- Returns
- Top-property of the RectTransform.
◆ CTHasActiveClip()
|
static |
Extension method for AudioSource. Determines if an AudioSource has an active clip.
- Parameters
-
source AudioSource to check.
- Returns
- True if the AudioSource has an active clip.
◆ CThasInvalidChars()
|
static |
Extension method for strings. Checks if the string has invalid characters.
- Parameters
-
str String-instance.
- Returns
- True if the string has invalid characters.
◆ CTHasInvalidChars()
|
static |
Extension method for strings. Checks if the string has invalid characters.
- Parameters
-
str String-instance.
- Returns
- True if the string has invalid characters.
◆ CThasLineEndings()
|
static |
Extension method for strings. Checks if the string has line endings.
- Parameters
-
str String-instance.
- Returns
- True if the string has line endings.
◆ CTHasLineEndings()
|
static |
Extension method for strings. Checks if the string has line endings.
- Parameters
-
str String-instance.
- Returns
- True if the string has line endings.
◆ CTHexToColor()
|
static |
Extension method for strings. Converts the Hex-value of a string to a Color.
- Parameters
-
hexString Input as Hex-string.
- Returns
- Hex-string value as Color.
◆ CTHexToColor32()
|
static |
Extension method for strings. Converts the Hex-value of a string to a Color32.
- Parameters
-
hexString Input as Hex-string.
- Returns
- Hex-string value as Color32.
◆ CTHexToString()
|
static |
Extension method for strings. Converts the Hex-value of a string to a string (with Unicode support).
- Parameters
-
hexString Input as Hex-string.
- Returns
- Hex-string value as converted string.
◆ CTIndexOf() [1/2]
|
static |
Extension method for strings. Returns the index of the first occurence of a given string.
- Parameters
-
str String-instance. toCheck String for the index. startIndex Start index for the check. comp StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase)
- Returns
- The index of the first occurence of the given string if the string is integer.
◆ CTIndexOf() [2/2]
|
static |
Extension method for strings. Returns the index of the first occurence of a given string.
- Parameters
-
str String-instance. toCheck String for the index. comp StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase)
- Returns
- The index of the first occurence of the given string if the string is integer.
◆ CTisAlphanumeric()
|
static |
Extension method for strings. Checks if the string is alphanumeric.
- Parameters
-
str String-instance.
- Returns
- True if the string is alphanumeric.
◆ CTIsAlphanumeric()
|
static |
Extension method for strings. Checks if the string is alphanumeric.
- Parameters
-
str String-instance.
- Returns
- True if the string is alphanumeric.
◆ CTisCreditcard()
|
static |
Extension method for strings. Checks if the string is a creditcard.
- Parameters
-
str String-instance.
- Returns
- True if the string is a creditcard.
◆ CTIsCreditcard()
|
static |
Extension method for strings. Checks if the string is a creditcard.
- Parameters
-
str String-instance.
- Returns
- True if the string is a creditcard.
◆ CTisEmail()
|
static |
Extension method for strings. Checks if the string is an email address.
- Parameters
-
str String-instance.
- Returns
- True if the string is an email address.
◆ CTIsEmail()
|
static |
Extension method for strings. Checks if the string is an email address.
- Parameters
-
str String-instance.
- Returns
- True if the string is an email address.
◆ CTisInteger()
|
static |
Extension method for strings. Checks if the string is integer.
- Parameters
-
str String-instance.
- Returns
- True if the string is integer.
◆ CTIsInteger()
|
static |
Extension method for strings. Checks if the string is integer.
- Parameters
-
str String-instance.
- Returns
- True if the string is integer.
◆ CTisIPv4()
|
static |
Extension method for strings. Checks if the string is an IPv4 address.
- Parameters
-
str String-instance.
- Returns
- True if the string is an IPv4 address.
◆ CTIsIPv4()
|
static |
Extension method for strings. Checks if the string is an IPv4 address.
- Parameters
-
str String-instance.
- Returns
- True if the string is an IPv4 address.
◆ CTisNumeric()
|
static |
Extension method for strings. Checks if the string is numeric.
- Parameters
-
str String-instance.
- Returns
- True if the string is numeric.
◆ CTIsNumeric()
|
static |
Extension method for strings. Checks if the string is numeric.
- Parameters
-
str String-instance.
- Returns
- True if the string is numeric.
◆ CTIsVisibleFrom()
|
static |
Extension method for Renderer. Determines if the renderer is visible from a certain camera.
- Parameters
-
renderer Renderer to test the visibility. camera Camera for the test.
- Returns
- True if the renderer is visible by the given camera.
◆ CTisWebsite()
|
static |
Extension method for strings. Checks if the string is a website address.
- Parameters
-
str String-instance.
- Returns
- True if the string is a website address.
◆ CTIsWebsite()
|
static |
Extension method for strings. Checks if the string is a website address.
- Parameters
-
str String-instance.
- Returns
- True if the string is a website address.
◆ CTLastIndexOf()
|
static |
Extension method for strings. Returns the index of the last occurence of a given string.
- Parameters
-
str String-instance. toCheck String for the index. comp StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase)
- Returns
- The index of the last occurence of the given string if the string is integer.
◆ CTMultiply() [1/3]
|
static |
Allows you to multiply two Vector2s together, something Unity sorely lacks by default.
- Parameters
-
a First vector b Second vector
- Returns
- The ax*bx, ay*by result.
◆ CTMultiply() [2/3]
|
static |
Allows you to multiply two Vector3s together, something Unity sorely lacks by default.
- Parameters
-
a First vector b Second vector
- Returns
- The ax*bx, ay*by, az*bz result.
◆ CTMultiply() [3/3]
|
static |
Allows you to multiply two Vector4s together, something Unity sorely lacks by default.
- Parameters
-
a First vector b Second vector
- Returns
- The ax*bx, ay*by, az*bz, aw*bw result.
◆ CTQuaternion() [1/2]
|
static |
Extension method for Vector3. Convert it to a Quaternion.
- Parameters
-
eulerAngle Vector3-instance to convert.
- Returns
- Quaternion from euler angles.
◆ CTQuaternion() [2/2]
|
static |
Extension method for Vector4. Convert it to a Quaternion.
- Parameters
-
angle Vector4-instance to convert.
- Returns
- Quaternion from Vector4.
◆ CTReadFully()
|
static |
Extension method for Stream. Reads the full content of a Stream.
- Parameters
-
input Stream-instance to read.
- Returns
- Byte-array of the Stream content.
◆ CTRemoveChars()
|
static |
Extension method for strings. Removes characters from a string
- Parameters
-
str String-instance. removeChars Characters to remove.
- Returns
- String without the given characters.
◆ CTRemoveNewLines()
|
static |
Extension method for strings. Replaces new lines with a replacement string pattern.
- Parameters
-
str String-instance. replacement Replacement string pattern (optional, default: "#nl#"). newLine New line string (optional, default: System.Environment.NewLine).
- Returns
- Replaced string without new lines.
◆ CTReplace()
|
static |
Extension method for strings. Default: case insensitive 'Replace'.
- Parameters
-
str String-instance. oldString String to replace. newString New replacement string. comp StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase)
- Returns
- Replaced string.
◆ CTReverse()
|
static |
Extension method for strings. Reverses a string.
- Parameters
-
str String-instance.
- Returns
- Reversed string.
◆ CTRotate180()
|
static |
Extension method for Texture. Rotates a Texture by 180 degrees.
- Parameters
-
texture Texture to rotate.
- Returns
- Rotated Texture.
◆ CTRotate270()
|
static |
Extension method for Texture. Rotates a Texture by 270 degrees.
- Parameters
-
texture Texture to rotate.
- Returns
- Rotated Texture.
◆ CTRotate90()
|
static |
Extension method for Texture. Rotates a Texture by 90 degrees.
- Parameters
-
texture Texture to rotate.
- Returns
- Rotated Texture.
◆ CTSetBottom()
|
static |
Extension method for RectTransform. Sets the Bottom-property of a RectTransform.
- Parameters
-
transform RectTransform to set the Bottom-property. value Value for the Bottom-property.
◆ CTSetLeft()
|
static |
Extension method for RectTransform. Sets the Left-property of a RectTransform.
- Parameters
-
transform RectTransform to set the Left-property. value Value for the Left-property.
◆ CTSetLRTB()
|
static |
Extension method for RectTransform. Sets the Left/Right/Top/Bottom-properties of a RectTransform.
- Parameters
-
transform RectTransform to set the Left/Right/Top/Bottom-properties. lrtb Left/Right/Top/Bottom-properties as Vector4.
◆ CTSetRight()
|
static |
Extension method for RectTransform. Sets the Right-property of a RectTransform.
- Parameters
-
transform RectTransform to set the Right-property. value Value for the Right-property.
◆ CTSetTop()
|
static |
Extension method for RectTransform. Sets the Top-property of a RectTransform.
- Parameters
-
transform RectTransform to set the Top-property. value Value for the Top-property.
◆ CTShuffle< T >() [1/2]
|
static |
Extension method for IList. Shuffles a List.
- Parameters
-
list IList-instance to shuffle. seed Seed for the PRNG (optional, default: 0 (=standard))
◆ CTShuffle< T >() [2/2]
|
static |
Extension method for arrays. Shuffles an array.
- Parameters
-
array Array-instance to shuffle. seed Seed for the PRNG (optional, default: 0 (=standard))
◆ CTStartsWith()
|
static |
Extension method for strings. Checks if the string starts with another string.
- Parameters
-
str String-instance. toCheck String to check. comp StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase)
- Returns
- True if the string is integer.
◆ CTToBase64() [1/2]
|
static |
Extension method for byte-arrays. Converts a byte-array to a Base64-string.
- Parameters
-
data Input as byte-array.
- Returns
- Base64-string from the byte-array.
◆ CTToBase64() [2/2]
|
static |
Extension method for strings. Converts the value of a string to a Base64-string.
- Parameters
-
str Input string. encoding Encoding of the string (optional, default: UTF8).
- Returns
- String value as converted Base64-string.
◆ CTToByteArray() [1/2]
|
static |
Extension method for float-arrays. Converts a float-array to a byte-array.
- Parameters
-
array Array-instance to convert. count Number of floats to convert (optional).
- Returns
- Converted byte-array.
◆ CTToByteArray() [2/2]
|
static |
Extension method for strings. Converts the value of a string to a byte-array.
- Parameters
-
str Input string. encoding Encoding of the string (optional, default: UTF8).
- Returns
- Byte-array with the string.
◆ CTToEXR() [1/2]
|
static |
Extension method for Sprite. Converts a Sprite to a EXR byte-array.
- Parameters
-
sprite Sprite to convert.
- Returns
- Converted Sprite as EXR byte-array.
◆ CTToEXR() [2/2]
|
static |
Extension method for Texture. Converts a Texture to a EXR byte-array.
- Parameters
-
texture Texture to convert.
- Returns
- Converted Texture as EXR byte-array.
◆ CTToFloatArray()
|
static |
Extension method for byte-arrays. Converts a byte-array to a float-array.
- Parameters
-
array Array-instance to convert. count Number of bytes to convert (optional).
- Returns
- Converted float-array.
◆ CTToHex()
|
static |
Extension method for strings. Converts the value of a string to a Hex-string (with Unicode support).
- Parameters
-
str Input string. addPrefix Add "0x"-as prefix (optional, default: false).
- Returns
- String value as converted Hex-string.
◆ CTToHexRGB() [1/2]
|
static |
Extension method for Color. Converts the value of a color to a RGB Hex-string.
- Parameters
-
input Color to convert.
- Returns
- Color value as Hex (format "RRGGBB").
◆ CTToHexRGB() [2/2]
|
static |
Extension method for Color32. Converts the value of a color to a RGB Hex-string.
- Parameters
-
input Color to convert.
- Returns
- Color value as Hex (format "RRGGBB").
◆ CTToHexRGBA() [1/2]
|
static |
Extension method for Color. Converts the value of a color to a RGBA Hex-string.
- Parameters
-
input Color to convert.
- Returns
- Color value as Hex (format "RRGGBBAA").
◆ CTToHexRGBA() [2/2]
|
static |
Extension method for Color32. Converts the value of a color to a RGBA Hex-string.
- Parameters
-
input Color to convert.
- Returns
- Color value as Hex (format "RRGGBBAA").
◆ CTToJPG() [1/2]
|
static |
Extension method for Sprite. Converts a Sprite to a JPG byte-array.
- Parameters
-
sprite Sprite to convert.
- Returns
- Converted Sprite as JPG byte-array.
◆ CTToJPG() [2/2]
|
static |
Extension method for Texture. Converts a Texture to a JPG byte-array.
- Parameters
-
texture Texture to convert.
- Returns
- Converted Texture as JPG byte-array.
◆ CTToPNG() [1/2]
|
static |
Extension method for Sprite. Converts a Sprite to a PNG byte-array.
- Parameters
-
sprite Sprite to convert.
- Returns
- Converted Sprite as PNG byte-array.
◆ CTToPNG() [2/2]
|
static |
Extension method for Texture. Converts a Texture to a PNG byte-array.
- Parameters
-
texture Texture to convert.
- Returns
- Converted Texture as PNG byte-array.
◆ CTToSprite() [1/2]
|
static |
Extension method for byte-arrays. Converts a byte-array to a Sprite. Supported image formats: PNG and JPG.
- Parameters
-
data byte-array-instance to convert. supportTexture Support texture to prevent possible texture garbage (optional).
- Returns
- Converted Sprite.
◆ CTToSprite() [2/2]
|
static |
Extension method for Texture. Converts a Texture to a Sprite.
- Parameters
-
texture Texture to convert. pixelsPerUnit Pixels per unit for the Sprite (optional, default: 100).
- Returns
- Converted Texture as Sprite.
◆ CTToString()
|
static |
Extension method for byte-arrays. Converts a byte-array to a string.
- Parameters
-
data Input string as byte-array. encoding Encoding of the string (optional, default: UTF8).
- Returns
- Byte-array with the string.
◆ CTToString< T >()
|
static |
Extension method for IList. Generates a string list with all entries (via ToString).
- Parameters
-
list IList-instance to ToString.
- Returns
- String list with all entries (via ToString).
◆ CTToStringArray< T >()
|
static |
Extension method for arrays. Generates a string array with all entries (via ToString).
- Parameters
-
array Array-instance to ToString.
- Returns
- String array with all entries (via ToString).
◆ CTToTexture()
|
static |
Extension method for byte-arrays. Converts a byte-array to a Texture. Supported image formats: PNG and JPG.
- Parameters
-
data byte-array-instance to convert. supportTexture Support texture to prevent possible texture garbage (optional).
- Returns
- Converted Texture.
◆ CTToTexture2D() [1/2]
|
static |
Extension method for Texture. Convert a Texture to a Texture2D
- Parameters
-
texture Texture to convert.
- Returns
- Converted Texture2D.
◆ CTToTexture2D() [2/2]
|
static |
Extension method for WebCamTexture. Convert a WebCamTexture to a Texture2D
- Parameters
-
texture WebCamTexture to convert.
- Returns
- Converted Texture2D.
◆ CTToTGA() [1/2]
|
static |
Extension method for Sprite. Converts a Sprite to a TGA byte-array.
- Parameters
-
sprite Sprite to convert.
- Returns
- Converted Sprite as TGA byte-array.
◆ CTToTGA() [2/2]
|
static |
Extension method for Texture. Converts a Texture to a TGA byte-array.
- Parameters
-
texture Texture to convert.
- Returns
- Converted Texture as TGA byte-array.
◆ CTToTitleCase()
|
static |
Extension method for strings. Converts a string to title case (first letter uppercase).
- Parameters
-
str String-instance.
- Returns
- Converted string in title case.
◆ CTVector3() [1/3]
|
static |
Extension method for Color. Convert it to a Vector3.
- Parameters
-
color Color-instance to convert.
- Returns
- Vector3 from color.
◆ CTVector3() [2/3]
|
static |
Extension method for Color32. Convert it to a Vector3.
- Parameters
-
color Color-instance to convert.
- Returns
- Vector3 from color.
◆ CTVector3() [3/3]
|
static |
Extension method for Quaternion. Convert it to a Vector3.
- Parameters
-
angle Quaternion-instance to convert.
- Returns
- Vector3 from Quaternion.
◆ CTVector4() [1/3]
|
static |
Extension method for Color. Convert it to a Vector4.
- Parameters
-
color Color-instance to convert.
- Returns
- Vector4 from color.
◆ CTVector4() [2/3]
|
static |
Extension method for Color32. Convert it to a Vector4.
- Parameters
-
color Color-instance to convert.
- Returns
- Vector4 from color.
◆ CTVector4() [3/3]
|
static |
Extension method for Quaternion. Convert it to a Vector4.
- Parameters
-
angle Quaternion-instance to convert.
- Returns
- Vector4 from Quaternion.
◆ GetColumn< T >()
|
static |
Extension method for 2D-arrays. Returns the column of a 2D-array as array.
- Parameters
-
matrix Input as 2D-array. columnNumber Desired column of the 2D-array
- Returns
- Column of a 2D-array as array.
◆ GetRow< T >()
|
static |
Extension method for 2D-arrays. Returns the row of a 2D-array as array.
- Parameters
-
matrix Input as 2D-array. columnNumber Desired row of the 2D-array
- Returns
- Row of a 2D-array as array.
The documentation for this class was generated from the following file:
- C:/Users/slaub/Unity/assets/Radio/RadioPro/Assets/Plugins/crosstales/Common/Scripts/ExtensionMethods.cs