Class InspectorUtility
Collection of tools and helpers for drawing inspectors
Namespace: Cinemachine.Editor
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<ScriptableObject> | assets | The list to add found assets to |
String | path | The location in which to look. Path is relative to package root. |
CreateGameObject(String, Type[])
Create a game object. Uses ObjectFactory if the Unity version is sufficient.
Declaration
public static GameObject CreateGameObject(string name, params Type[] types)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name to give the object |
Type[] | types | Optional components to add |
Returns
Type | Description |
---|---|
GameObject |
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 |
SerializedProperty[] | 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 |
---|---|---|
AnimationCurve | curve | Curve to normalize |
Returns
Type | Description |
---|---|
AnimationCurve | 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 |