Class CinemachineSplineRoll
Extension that can be added to a SplineContainer or a CinemachineCamera that uses a SplineContainer, for example a CinemachineCamera that has SplineDolly as Body component.
- When CinemachineSplineRoll is added to a gameObject that has SplineContainer, then the roll affects any CinemachineCamera that reads that SplineContainer globally.
- When CinemachineSplineRoll is added to a CinemachineCamera, then roll only affects that CinemachineCamera locally.
Implements
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[ExecuteInEditMode]
[DisallowMultipleComponent]
[AddComponentMenu("Cinemachine/Helpers/Cinemachine Spline Roll")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/CinemachineSplineRoll.html")]
public class CinemachineSplineRoll : MonoBehaviour, ISerializationCallbackReceiver
Fields
Easing
When enabled, roll eases into and out of the data point values. Otherwise, interpolation is linear.
Declaration
[Tooltip("When enabled, roll eases into and out of the data point values. Otherwise, interpolation is linear.")]
public bool Easing
Field Value
Type | Description |
---|---|
bool |
Roll
Roll (in degrees) around the forward direction for specific location on the track. When placed on a SplineContainer, this is going to be a global override that affects all vcams using the Spline. When placed on a CinemachineCamera, this is going to be a local override that only affects that CinemachineCamera.
Declaration
public SplineData<CinemachineSplineRoll.RollData> Roll
Field Value
Type | Description |
---|---|
SplineData<CinemachineSplineRoll.RollData> |
Remarks
It is not recommended to modify the data array at runtime, because the infrastructure expects the array to be in strclty increasing order of distance along the spline. If you do change the array at runtime, you must take care to keep it in this order, or the results will be unpredictable.
Methods
GetInterpolator()
Get the appropriate interpolator for the RollData, depending on the Easing setting
Declaration
public IInterpolator<CinemachineSplineRoll.RollData> GetInterpolator()
Returns
Type | Description |
---|---|
IInterpolator<CinemachineSplineRoll.RollData> | The appropriate interpolator for the RollData, depending on the Easing setting. |
OnAfterDeserialize()
Implement this method to receive a callback after Unity deserializes your object.
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Implement this method to receive a callback before Unity serializes your object.
Declaration
public void OnBeforeSerialize()