Class InspectorUtility
Collection of tools and helpers for drawing inspectors
Inherited Members
Namespace: Cinemachine.Editor
Assembly: com.unity.cinemachine.editor.dll
Syntax
public class InspectorUtility
Methods
AddAssetsFromPackageSubDirectory(Type, List<ScriptableObject>, string)
Add to a list all assets of a given type found in a given location
Declaration
public static void AddAssetsFromPackageSubDirectory(Type type, List<ScriptableObject> assets, string path)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The asset type to look for |
List<Scriptable |
assets | The list to add found assets to |
string | path | The location in which to look. Path is relative to package root. |
MultiPropertyOnLine(Rect, GUIContent, SerializedProperty[], GUIContent[])
Put multiple properties on a single inspector line, with optional label overrides. Passing null as a label (or sublabel) override will cause the property's displayName to be used as a label. For no label at all, pass GUIContent.none.
Declaration
public static void MultiPropertyOnLine(Rect rect, GUIContent label, SerializedProperty[] props, GUIContent[] subLabels)
Parameters
Type | Name | Description |
---|---|---|
Rect | rect | Rect in which to draw |
GUIContent | label | Main label |
Serialized |
props | Properties to place on the line |
GUIContent[] | subLabels | Sublabels for the properties |
NicifyClassName(string)
Remove the "Cinemachine" prefix, then call the standard Unity Nicify.
Declaration
public static string NicifyClassName(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name to nicify |
Returns
Type | Description |
---|---|
string | The nicified name |
NormalizeCurve(AnimationCurve)
Normalize a curve so that each of X and Y axes ranges from 0 to 1
Declaration
public static AnimationCurve NormalizeCurve(AnimationCurve curve)
Parameters
Type | Name | Description |
---|---|---|
Animation |
curve | Curve to normalize |
Returns
Type | Description |
---|---|
Animation |
The normalized curve |
RepaintGameView(Object)
Force a repaint of the Game View
Declaration
public static void RepaintGameView(Object unused = null)
Parameters
Type | Name | Description |
---|---|---|
Object | unused | Like it says |