Class RuntimeUtility
An ad-hoc collection of helpers, used by Cinemachine or its editor tools in various places
Namespace: Unity.Cinemachine
Syntax
public static class RuntimeUtility
Methods
DestroyObject(Object)
Convenience to destroy an object, using the appropriate method depending on whether the game is playing
Declaration
public static void DestroyObject(Object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The object to destroy |
IsPrefab(GameObject)
Check whether a GameObject is a prefab.
For editor only - some things are disallowed if prefab. In runtime, will always return false.
Declaration
public static bool IsPrefab(GameObject gameObject)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gameObject | the object to check |
Returns
Type | Description |
---|---|
Boolean | If editor, checks if object is a prefab or prefab instance. |
NormalizeCurve(AnimationCurve, Boolean, Boolean)
Normalize a curve so that its X and Y axes range from 0 to 1
Declaration
public static AnimationCurve NormalizeCurve(AnimationCurve curve, bool normalizeX, bool normalizeY)
Parameters
Type | Name | Description |
---|---|---|
AnimationCurve | curve | Curve to normalize |
Boolean | normalizeX | If true, normalize the X axis |
Boolean | normalizeY | If true, normalize the Y axis |
Returns
Type | Description |
---|---|
AnimationCurve | The normalized curve |