Summary
Various utility methods used by
InspectorGadgets
.- Assembly
- Kybernetik
.InspectorGadgets .dll - Namespace
- InspectorGadgets
- Base Types
-
- Object
graph BT
Type-->Base0["Object"]
Type["IGUtils"]
class Type type-node
Syntax
public static class IGUtils
Methods
Name | Value | Summary |
---|---|---|
AppendDeepToString |
void |
Each element returned by `enumerator` is appended to `text`.
static
|
Append |
int |
Appends the generic arguments of `type` (after skipping the specified number).
static
|
AppendNameCS |
StringBuilder |
Appends the full name of a `member` as it would appear in C# code.
For example, passing this method info in as its own parameter would append "
InspectorGadgets.IGUtils .AppendName".
Note that when `member` is a System.Type , this method calls InspectorGadgets.IGUtils.GetNameCS(System.Type,System.Boolean) instead.
static
|
AppendTransformPath |
void |
Appends the full transform path to the target with slashes between the names of each of its parents, much like a file path.
static
|
Calculate |
int |
Calculate the number of removals, inserts, and replacements needed to turn `a` into `b`.
static
|
Convert |
string |
Adds spaces to `camelCase` before each uppercase letter.
static
|
Convert |
void |
Adds spaces to `camelCase` before each uppercase letter.
static
|
Convert |
string |
Adds spaces to `fieldName` before each uppercase letter and removes any underscores from the start.
static
|
CopyCurve |
AnimationCurve |
Creates a duplicate of the given `curve`.
static
|
DeepToString |
string |
Returns a string containing the value of each element in `collection` (each on a new line).
static
|
DeepToString |
string |
Returns a string containing the value of each element in `collection`.
static
|
DeepToString |
string |
Returns a string containing the value of each element in `enumerator` (each on a new line).
static
|
DeepToString |
string |
Returns a string containing the value of each element in `enumerator`.
static
|
Enforce |
AnimationCurve |
Ensures that the curve is horizontally symmetrical in relation to its existing start and end points.
static
|
ExtendMirrorred |
AnimationCurve |
Duplicates the curve past the end and mirrors the duplicated section.
Returns the input curve so calls can be chained.
static
|
FindType |
Type |
Calls
System.Reflection.Assembly.GetType(System.String,System.Boolean,System.Boolean) on each currently loaded assembly until it finds a
match then returns it.
static
|
FlipHorizontal |
AnimationCurve |
Reverses the curve so that it runs backwards over the same time range.
Returns the input curve so calls can be chained.
static
|
FlipVertical |
AnimationCurve |
Reverses the curve so that its values are upside down within range.
Returns the input curve so calls can be chained.
static
|
FlipWeightedMode |
WeightedMode |
UnityEngine.WeightedMode.Out becomes UnityEngine.WeightedMode.In and vice versa.
static
|
ForEachType |
void |
Calls the specified `method` once for each type in the specified `assembly`.
static
|
For |
void |
Calls the specified `method` once for each type in each loaded assembly that references the specified `assembly`.
static
|
GetAttributedFields |
void |
Get all fields with the specified attribute in `type`.
static
|
GetAttributedMethods |
void |
Get all methods with the specified attribute in `type`.
static
|
Get |
void |
Get all properties with the specified attribute in `type`.
static
|
GetBestMatch |
T |
Compares the name of each of the `objects` and returns the one that is closest to the `nameHint`.
See also:
InspectorGadgets.IGUtils.CalculateLevenshteinDistance(System.String,System.String) .
static
|
GetBestMatch |
T |
Compares the name of each of the `objects` and returns the one that is closest to the `nameHint`.
See also:
InspectorGadgets.IGUtils.CalculateLevenshteinDistance(System.String,System.String) .
static
|
Get |
Component |
Finds a component of the specified `componentType` on the `gameObject` or any of its parents or children.
If multiple components are found the one with a name closest to the `nameHint` is chosen.
static
|
GetCustomAttribute |
T |
Gets a single custom attribute of type T and casts it.
static
|
GetDerivedTypes |
List |
Gets all non-abstract types in the currently loaded assemblies which derive from the specified base type
(including the base type itself if it is not abstract).
static
|
GetDerivedTypes |
void |
Gets all non-abstract types in the currently loaded assemblies which derive from the specified base type
(including the base type itself if it is not abstract).
static
|
GetDescription |
string |
Returns a string describing the start and end time and value of the `curve`.
static
|
GetMinMaxKeyValue |
void |
Gets the values of the lowest and highest keyframes.
Note that these will not necessarily be the exact bounds of the curve if the tangents cause it to continue
further than the keyframes.
static
|
GetMinMaxKeyValue |
void |
Gets the values of the lowest and highest keyframes.
Note that these will not necessarily be the exact bounds of the curve if the tangents cause it to continue
further than the keyframes.
static
|
Get |
void |
Estimates the highest and lowest values in the `curve`.
static
|
GetNameCS |
string |
Returns the full name of a `member` as it would appear in C# code.
For example, passing this method info in as its own parameter would return "
InspectorGadgets.IGUtils .GetNameCS".
Note that when `member` is a System.Type , this method calls InspectorGadgets.IGUtils.GetNameCS(System.Type,System.Boolean) instead.
static
|
GetNameCS |
string |
Returns the name of a `type` as it would appear in C# code.
For example, typeof(List<float>).FullName would give you:
System.Collections.Generic.List`1[[System.Single, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
This method would instead return System.Collections.Generic.List<float> if `fullName` is true, or
just List<float> if it is false.
Note that all returned values are stored in a dictionary to speed up repeated use.
static
|
GetOrAdd |
TValue |
If the specified `key` is present in the `dictionary`, its value is returned.
Otherwise a new value is added to the `dictionary` and returned.
static
|
GetStartEndTime |
void |
Gets the time of the first and last keyframes.
static
|
GetStartEndTime |
void |
Gets the time of the first and last keyframes.
static
|
GetStartEndValue |
void |
Gets the value of the first and last keyframes.
static
|
GetStartEndValue |
void |
Gets the value of the first and last keyframes.
static
|
Get |
void |
Gets the higher and lower value of the first and last keyframes.
static
|
Get |
void |
Gets the higher and lower value of the first and last keyframes.
static
|
GetTransform |
Transform |
Returns the
UnityEngine.GameObject.transform or UnityEngine.Component.transform .static
|
GetTransformPath |
string |
Appends the full transform path to the target with slashes between the names of each of its parents, much like a file path.
static
|
IsNormalized |
bool |
Indicates whether the time and values both start at 0 and end at 1.
static
|
IsNormalized |
bool |
Indicates whether the time and values both start at 0 and end at 1.
static
|
LinearRescale |
float |
Re-scales `value` from the old range (`oldMin` to `oldMax`) to the new range (`newMin` to `newMax`).
static
|
LinearRescaleTo01 |
float |
Re-scales `value` from the old range (`oldMin` to `oldMax`) to the new range (0 to 1).
static
|
Normalize |
AnimationCurve |
Rescales the curve so the time and values both start at 0 and end at 1.
Note that this does not modify any of the tangents so the shape of the curve may change.
Returns the input curve so calls can be chained.
static
|
Normalize |
Keyframe[] |
Rescales the curve so the time and values both start at 0 and end at 1.
Returns the input array so calls can be chained.
static
|
ProgressiveSearch |
Component |
Tries various search methods in the following order until it finds something:
UnityEngine.GameObject.GetComponent(System.Type) ,
UnityEngine.GameObject.GetComponentsInParent(System.Type,System.Boolean) ,
UnityEngine.GameObject.GetComponentsInChildren(System.Type,System.Boolean) ,
UnityEngine.Resources.FindObjectsOfTypeAll(System.Type) .
In the first group where a component of the correct type is found, if multiple components were found the
one with a name closest to the `nameHint` is chosen.
static
|
Set |
void |
If `source` is not null, `target` is given its value.
static
|
Set |
float |
If `source` is not null, return its value, otherwise return `target`.
static
|
SmoothTangents |
AnimationCurve |
Smooths the tangents of all keyframes.
Returns the input curve so calls can be chained.
static
|
StableInsertionSort |
void |
Sorts `list`, maintaining the order of any elements with an identical comparison
(unlike the standard
System.Collections.Generic.List`1.Sort method).
static
|
StableInsertionSort |
void |
Sorts `list`, maintaining the order of any elements with an identical comparison
(unlike the standard
System.Collections.Generic.List`1.Sort(System.Comparison{`0}) method).
static
|
ToColor |
Color |
Converts a
UnityEngine.Vector3 to a UnityEngine.Color .static
|
ToColor |
Color |
Converts a
UnityEngine.Vector4 to a UnityEngine.Color .static
|
ToDisplayString |
string |
Returns the specified `value` as a string using the
System.Globalization.CultureInfo.InvariantCulture .static
|
ToDisplayString |
string |
Returns the specified `value` as a string, or "-" if it is null.
static
|
ToVector3 |
Vector3 |
Converts a
UnityEngine.Color to a UnityEngine.Vector3 .static
|
ToVector4 |
Vector4 |
Converts a
UnityEngine.Color to a UnityEngine.Vector4 .static
|
TruncateForLabel |
string |
Truncate the given string so it can be used in a GUI.Label. MaxLength = 16,382.
static
|