Struct ScreenComposerSettings
This structure holds settings for screen-space composition.
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[Serializable]
public struct ScreenComposerSettings
Fields
DeadZone
The camera will not adjust if the target is within this range of the screen position
Declaration
[Tooltip("The camera will not adjust if the target is within this range of the screen position")]
[FoldoutWithEnabledButton("Enabled")]
public ScreenComposerSettings.DeadZoneSettings DeadZone
Field Value
Type | Description |
---|---|
ScreenComposerSettings.DeadZoneSettings |
HardLimits
The target will not be allowed to be outside this region. When the target is within this region, the camera will gradually adjust to re-align towards the desired position, depending on the damping speed
Declaration
[Tooltip("The target will not be allowed to be outside this region. When the target is within this region, the camera will gradually adjust to re-align towards the desired position, depending on the damping speed")]
[FoldoutWithEnabledButton("Enabled")]
public ScreenComposerSettings.HardLimitSettings HardLimits
Field Value
Type | Description |
---|---|
ScreenComposerSettings.HardLimitSettings |
ScreenPosition
Screen position for target. The camera will adjust to position the tracked object here. 0 is screen center, and +0.5 or -0.5 is screen edge
Declaration
[Tooltip("Screen position for target. The camera will adjust to position the tracked object here. 0 is screen center, and +0.5 or -0.5 is screen edge")]
public Vector2 ScreenPosition
Field Value
Type | Description |
---|---|
Vector2 |
Properties
DeadZoneRect
Get/set the screenspace rect for the dead zone region. This also defines screen position
Declaration
public Rect DeadZoneRect { get; set; }
Property Value
Type | Description |
---|---|
Rect |
Default
The default screen composition
Declaration
public static ScreenComposerSettings Default { get; }
Property Value
Type | Description |
---|---|
ScreenComposerSettings |
EffectiveDeadZoneSize
Get the effective dead zone size, taking enabled state into account
Declaration
public Vector2 EffectiveDeadZoneSize { get; }
Property Value
Type | Description |
---|---|
Vector2 |
EffectiveHardLimitSize
Get the effective hard limits size, taking enabled state into account
Declaration
public Vector2 EffectiveHardLimitSize { get; }
Property Value
Type | Description |
---|---|
Vector2 |
HardLimitsRect
Get/set the screenspace rect for the hard limits.
Declaration
public Rect HardLimitsRect { get; set; }
Property Value
Type | Description |
---|---|
Rect |
Methods
Approximately(in ScreenComposerSettings, in ScreenComposerSettings)
Tests whether 2 ScreenComposerSettings are approximately equal.
Declaration
public static bool Approximately(in ScreenComposerSettings a, in ScreenComposerSettings b)
Parameters
Type | Name | Description |
---|---|---|
ScreenComposerSettings | a | First settings object |
ScreenComposerSettings | b | Second settings object |
Returns
Type | Description |
---|---|
bool | True if all fields are equal to within a small epsilon value |
Lerp(in ScreenComposerSettings, in ScreenComposerSettings, float)
Linear interpolation between 2 settings objects.
Declaration
public static ScreenComposerSettings Lerp(in ScreenComposerSettings a, in ScreenComposerSettings b, float t)
Parameters
Type | Name | Description |
---|---|---|
ScreenComposerSettings | a | First settings object |
ScreenComposerSettings | b | Second settings object |
float | t | Interpolation amount: 0 is a, 1 is b |
Returns
Type | Description |
---|---|
ScreenComposerSettings | The interpolated value. |
Validate()
Clamps values to the expected ranges
Declaration
public void Validate()