Summary
[Editor-Only] Various utility methods used by
InspectorGadgets.- Assembly
- Kybernetik
.InspectorGadgets .Editor .dll - Namespace
- InspectorGadgets
.Editor - Base Types
-
- Object
graph BT
Type-->Base0["Object"]
Type["IGEditorUtils"]
class Type type-node
Syntax
public static class IGEditorUtils
Fields
| Name | Constant Value | Summary |
|---|---|---|
| AnyAccessBindings | 60 |
Commonly used
System.Reflection.BindingFlags.static
|
| InstanceBindings | 52 |
Commonly used
System.Reflection.BindingFlags.static
|
| StaticBindings | 56 |
Commonly used
System.Reflection.BindingFlags.static
|
Properties
| Name | Value | Summary |
|---|---|---|
| DefaultEditorState | EditorState |
Determines when to show Inspectable attributes if not specified in their constructor.
static
|
| DontExpandWidth | GUILayoutOption[] |
A single
UnityEngine.GUILayoutOption created by passing false into UnityEngine.GUILayout.ExpandWidth(System.Boolean).
static
|
| IndentSize | float |
The number of pixels of indentation for each
UnityEditor.EditorGUI.indentLevel increment.static
|
| MoveSnapVector | Vector3 |
Wraps
UnityEditor.EditorSnapSettings.move.static
|
| RotationSnap | float |
Wraps
UnityEditor.EditorSnapSettings.rotate.static
|
| RotationSnapVector | Vector3 |
(
InspectorGadgets.Editor.IGEditorUtils.RotationSnap, InspectorGadgets.Editor.IGEditorUtils.RotationSnap, InspectorGadgets.Editor.IGEditorUtils.RotationSnap).static
|
| ScaleSnap | float |
Wraps
UnityEditor.EditorSnapSettings.scale.static
|
| ScaleSnapVector | Vector3 |
(
InspectorGadgets.Editor.IGEditorUtils.ScaleSnap, InspectorGadgets.Editor.IGEditorUtils.ScaleSnap, InspectorGadgets.Editor.IGEditorUtils.ScaleSnap).static
|
| Spacing | float |
UnityEditor.EditorGUIUtility.standardVerticalSpacing. This value is 2 in Unity 2018.static
|
Methods
| Name | Value | Summary |
|---|---|---|
| AllBackslashes |
string |
Replaces any forward slashes with backslashes:
/ -> \.static
|
| AppendColorTag |
void |
Appends the a rich text color tag around the `message`.
static
|
| AppendColorToHex |
void |
Appends the hexadecimal representation of `color`.
static
|
| CalculateWidth |
float |
Calls
UnityEngine.GUIStyle.CalcMinMaxWidth(UnityEngine.GUIContent,System.Single@,System.Single@) and returns the max width.static
|
| CalculateWidth |
float |
Calls
UnityEngine.GUIStyle.CalcMinMaxWidth(UnityEngine.GUIContent,System.Single@,System.Single@) and returns the max width.static
|
| ColorToHex |
string |
Returns a string containing the hexadecimal representation of `color`.
static
|
| DoDelegateGUI |
void |
Draw the target and name of the specified
System.Delegate.static
|
| DoInspectableGUI |
void |
[Pro-Only]
Draws the GUI for all
InspectorGadgets.Attributes.BaseInspectableAttributes of the `targets`.
static
|
| DoLayerMaskField |
int |
Make a field for layer masks.
static
|
| FindAssetGuidsOfType |
string[] |
Calls
UnityEditor.AssetDatabase.FindAssets(System.String,System.String[]) using the specified `type` as the filter.
If the `type` inherits from UnityEngine.Component then it will instead use UnityEngine.GameObject as
the filter to find all Prefabs (since Unity won't find UnityEngine.Component types directly).
static
|
| FindAssetOfType |
Object |
Searches through all assets of the specified `type` and returns the one with a name closest to the
`nameHint`.
static
|
| ForEachProperty |
void |
Calls the specified `method` for each
UnityEditor.SerializedProperty in the `serializedObject` then
applies any modified properties.
static
|
| GetCachedStyle |
GUIStyle |
Creates a
UnityEngine.GUIStyle using the provided delegate and caches it so the same style can be
returned when this method is called again for the same delegate.
static
|
| Get |
Transform |
Gets the transform of an available camera from a scene view or the scene.
static
|
| Get |
void |
Gets the transform of an available camera from a scene view or the scene.
static
|
| Get |
string |
Returns the default file extension for a type derived from
UnityEngine.Object.static
|
| Get |
Transform |
Gets the transform of an available camera from a scene view.
static
|
| Get |
Transform |
Gets the transform of an available camera from a scene view.
static
|
| GetSensitivity |
float |
Returns a value of 1 multiplied if `fast` and divided if `slow`.
static
|
| GetSensitivity |
float |
Returns a value of 1 multiplied if
UnityEngine.Event.shift and divided if UnityEngine.Event.control.
static
|
| GetSensitivity |
float |
Returns a value of 1 multiplied if
UnityEngine.Event.shift and divided if UnityEngine.Event.control.
static
|
| Get |
IDisposable |
Returns a disposable context that will allow copy and paste commands to be executed on the `property`.
static
|
| GroupedInvoke |
void |
When a context menu function is executed with multiple objects selected, it calls the method once for each
object. Passing each `command` into this method will group them all into a list and invoke the specified
`method` once they have all been gathered.
static
|
| IsNow |
bool |
Returns true if the Unity Editor is currently in the specified `state`.
static
|
| IsSnapped |
bool |
Returns true if `value` is approximately equal to a multiple of `snap`.
static
|
| OnSceneGUI |
Action |
Registers the specified method to be called while drawing the
UnityEditor.SceneView GUI.static
|
| OnSceneGUI |
void |
Registers the specified method to be called while drawing the
UnityEditor.SceneView GUI.static
|
| OnSceneGUI |
Action |
Registers the specified method to be called while drawing the
UnityEditor.SceneView GUI.static
|
| Snap |
float |
Snaps the given `value` to a grid with the specified `snap` size.
static
|
| SnapPosition |
Vector3 |
Snaps the given `position` to the grid (as specified in Edit/Snap Settings).
static
|
| SnapPosition |
Vector3 |
Snaps the given `position` to the grid on the specified axis (as specified in Edit/Snap Settings).
static
|
| SnapRotation |
Quaternion |
Snaps the given `rotation` to the nearest snap increment on all axes (as specified in Edit/Snap Settings).
static
|
| SnapRotation |
Quaternion |
Snaps the given `rotation` to the nearest snap increment on the specified axis (as specified in Edit/Snap Settings).
static
|
| SnapRotation |
Vector3 |
Snaps the given `rotationEuler` to the nearest snap increment on all axes (as specified in Edit/Snap Settings).
static
|
| SnapRotation |
Vector3 |
Snaps the given `rotationEuler` to the nearest snap increment on the specified axis (as specified in Edit/Snap Settings).
static
|
| SnapScale |
Vector3 |
Snaps the given `scale` to the nearest snap increment on all axes (as specified in Edit/Snap Settings).
static
|
| SnapScale |
Vector3 |
Snaps the given `scale` to the nearest snap increment on the specified axis (as specified in Edit/Snap Settings).
static
|
| StealFromLeft |
Rect |
Subtracts the `width` from the left side of the `area` and returns a new
UnityEngine.Rect occupying the
removed section.
static
|
| StealFromLeft |
Rect |
Subtracts the `width` from the left side of the `area` and returns a new
UnityEngine.Rect occupying the
removed section.
static
|
| StealFromRight |
Rect |
Subtracts the `width` from the right side of the `area` and returns a new
UnityEngine.Rect occupying the
removed section.
static
|
| StealFromRight |
Rect |
Subtracts the `width` from the right side of the `area` and returns a new
UnityEngine.Rect occupying the
removed section.
static
|
| TempContent |
GUIContent |
Creates and returns a
UnityEngine.GUIContent with the specified parameters on the first call and then
simply returns the same one with new parameters on each subsequent call.
static
|
| ValueOrDefault |
EditorState |
Returns the `state` as long as it isn't
null.
Otherwise returns the InspectorGadgets.Editor.IGEditorUtils.DefaultEditorState.
static
|