Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMCL-0000: deprecate RangeSliderAttribute #944

Merged
merged 1 commit into from Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

This file was deleted.

This file was deleted.

Expand Up @@ -76,7 +76,7 @@ public struct Preset
/// This is the camera view in vertical degrees. For cinematic people, a 50mm lens
/// on a super-35mm sensor would equal a 19.6 degree FOV
/// </summary>
[RangeSlider(1f, 179f)]
[Range(1f, 179f)]
[Tooltip("This is the camera view in vertical degrees. For cinematic people, "
+ " a 50mm lens on a super-35mm sensor would equal a 19.6 degree FOV")]
[FormerlySerializedAs("m_FieldOfView")]
Expand Down
Expand Up @@ -62,7 +62,7 @@ public class CinemachineConfiner2D : CinemachineExtension

/// <summary>Damping applied automatically around corners to avoid jumps.</summary>
[Tooltip("Damping applied around corners to avoid jumps. Higher numbers are more gradual.")]
[RangeSlider(0, 5)]
[Range(0, 5)]
[FormerlySerializedAs("m_Damping")]
public float Damping;

Expand Down
Expand Up @@ -95,23 +95,23 @@ public enum ResolutionStrategy
/// Upper limit on how many obstacle hits to process. Higher numbers may impact performance.
/// In most environments, 4 is enough.
/// </summary>
[RangeSlider(1, 10)]
[Range(1, 10)]
[Tooltip("Upper limit on how many obstacle hits to process. Higher numbers may impact performance. "
+ "In most environments, 4 is enough.")]
public int MaximumEffort;

/// <summary>
/// Smoothing to apply to obstruction resolution. Nearest camera point is held for at least this long.
/// </summary>
[RangeSlider(0, 2)]
[Range(0, 2)]
[Tooltip("Smoothing to apply to obstruction resolution. Nearest camera point is held for at least this long")]
public float SmoothingTime;

/// <summary>
/// How gradually the camera returns to its normal position after having been corrected.
/// Higher numbers will move the camera more gradually back to normal.
/// </summary>
[RangeSlider(0, 10)]
[Range(0, 10)]
[Tooltip("How gradually the camera returns to its normal position after having been corrected. "
+ "Higher numbers will move the camera more gradually back to normal.")]
public float Damping;
Expand All @@ -120,7 +120,7 @@ public enum ResolutionStrategy
/// How gradually the camera moves to resolve an occlusion.
/// Higher numbers will move the camera more gradually.
/// </summary>
[RangeSlider(0, 10)]
[Range(0, 10)]
[Tooltip("How gradually the camera moves to resolve an occlusion. "
+ "Higher numbers will move the camera more gradually.")]
public float DampingWhenOccluded;
Expand Down
Expand Up @@ -24,7 +24,7 @@ public class CinemachineFollowZoom : CinemachineExtension

/// <summary>Increase this value to soften the aggressiveness of the follow-zoom.
/// Small numbers are more responsive, larger numbers give a more heavy slowly responding camera. </summary>
[RangeSlider(0f, 20f)]
[Range(0f, 20f)]
[Tooltip("Increase this value to soften the aggressiveness of the follow-zoom. "
+ "Small numbers are more responsive, larger numbers give a more heavy slowly responding camera.")]
[FormerlySerializedAs("m_Damping")]
Expand Down
Expand Up @@ -33,7 +33,7 @@ public enum FramingModes
/// <summary>How much of the screen to fill with the bounding box of the targets.</summary>
[Tooltip("The bounding box of the targets should occupy this amount of the screen space. "
+ "1 means fill the whole screen. 0.5 means fill half the screen, etc.")]
[RangeSlider(0, 2)]
[Range(0, 2)]
public float FramingSize = 0.8f;

/// <summary>A nonzero value will offset the group in the camera frame.</summary>
Expand All @@ -42,7 +42,7 @@ public enum FramingModes

/// <summary>How aggressively the camera tries to frame the group.
/// Small numbers are more responsive</summary>
[RangeSlider(0, 20)]
[Range(0, 20)]
[Tooltip("How aggressively the camera tries to frame the group. Small numbers are more responsive, "
+ "rapidly adjusting the camera to keep the group in the frame. Larger numbers give a heavier "
+ "more slowly responding camera.")]
Expand Down
Expand Up @@ -52,15 +52,15 @@ public class CinemachineRecomposer : CinemachineExtension
/// <summary>
/// Lowering this value relaxes the camera's attention to the Follow target (normal = 1)
/// </summary>
[RangeSlider(0, 1)]
[Range(0, 1)]
[Tooltip("Lowering this value relaxes the camera's attention to the Follow target (normal = 1)")]
[FormerlySerializedAs("m_FollowAttachment")]
public float FollowAttachment;

/// <summary>
/// Lowering this value relaxes the camera's attention to the LookAt target (normal = 1)
/// </summary>
[RangeSlider(0, 1)]
[Range(0, 1)]
[Tooltip("Lowering this value relaxes the camera's attention to the LookAt target (normal = 1)")]
[FormerlySerializedAs("m_LookAtAttachment")]
public float LookAtAttachment;
Expand Down
Expand Up @@ -58,7 +58,7 @@ public enum FillStrategy
/// </summary>
[Tooltip("The opacity of the image. 0 is transparent, 1 is opaque")]
[FormerlySerializedAs("m_Alpha")]
[RangeSlider(0, 1)]
[Range(0, 1)]
public float Alpha = 1;

/// <summary>
Expand Down Expand Up @@ -99,7 +99,7 @@ public enum FillStrategy
/// <summary>
/// Wipe the image on and off horizontally
/// </summary>
[RangeSlider(-1, 1)]
[Range(-1, 1)]
[Tooltip("Wipe the image on and off horizontally")]
[FormerlySerializedAs("m_SplitView")]
public float SplitView = 0f;
Expand Down
Expand Up @@ -518,7 +518,7 @@ public struct Settings
/// determines final placement on the Y axis</summary>
[Tooltip("Controls how taut is the line that connects the rigs' orbits, "
+ "which determines final placement on the Y axis")]
[RangeSlider(0f, 1f)]
[Range(0f, 1f)]
public float SplineCurvature;

/// <summary>Default orbit rig</summary>
Expand Down
Expand Up @@ -105,7 +105,7 @@ public struct DampingSettings

/// <summary>How aggressively the camera tries to maintain the desired rotation.
/// This is only used if Camera Rotation is not Default.</summary>
[RangeSlider(0f, 20f)]
[Range(0f, 20f)]
[Tooltip("How aggressively the camera tries to maintain the desired rotation. "
+ "This is only used if Camera Rotation is not Default.")]
public float Angular;
Expand Down
Expand Up @@ -44,7 +44,7 @@ public class CinemachineThirdPersonFollow : CinemachineComponentBase

/// <summary>Specifies which shoulder (left, right, or in-between) the camera is on.</summary>
[Tooltip("Specifies which shoulder (left, right, or in-between) the camera is on")]
[RangeSlider(0, 1)]
[Range(0, 1)]
public float CameraSide;

/// <summary>How far behind the hand the camera will be placed.</summary>
Expand Down Expand Up @@ -80,14 +80,14 @@ public struct ObstacleSettings
/// Specifies how close the camera can get to obstacles
/// </summary>
[Tooltip("Specifies how close the camera can get to obstacles")]
[RangeSlider(0, 1)]
[Range(0, 1)]
public float CameraRadius;

/// <summary>
/// How gradually the camera moves to correct for occlusions.
/// Higher numbers will move the camera more gradually.
/// </summary>
[RangeSlider(0, 10)]
[Range(0, 10)]
[Tooltip("How gradually the camera moves to correct for occlusions. " +
"Higher numbers will move the camera more gradually.")]
public float DampingIntoCollision;
Expand All @@ -96,7 +96,7 @@ public struct ObstacleSettings
/// How gradually the camera returns to its normal position after having been corrected by the built-in
/// collision resolution system. Higher numbers will move the camera more gradually back to normal.
/// </summary>
[RangeSlider(0, 10)]
[Range(0, 10)]
[Tooltip("How gradually the camera returns to its normal position after having been corrected by the built-in " +
"collision resolution system. Higher numbers will move the camera more gradually back to normal.")]
public float DampingFromCollision;
Expand Down
Expand Up @@ -56,6 +56,7 @@ public EnabledPropertyAttribute(string enabledProperty = "Enabled", string toggl
/// <summary>
/// Property applied to int or float fields to generate a slider in the inspector.
/// </summary>
[Obsolete("Use RangeAttribute instead")]
public sealed class RangeSliderAttribute : PropertyAttribute
{
/// <summary>Minimum value for the range slider</summary>
Expand Down
10 changes: 5 additions & 5 deletions com.unity.cinemachine/Runtime/Core/LensSettings.cs
Expand Up @@ -16,7 +16,7 @@ public struct LensSettings
/// be in horizontal degress. Internally, it is always vertical degrees.
/// For cinematic people, a 50mm lens on a super-35mm sensor would equal a 19.6 degree FOV.
/// </summary>
[RangeSlider(1f, 179f)]
[Range(1f, 179f)]
[Tooltip("This is the camera vertical field of view in degrees. Display will be in vertical degress, unless the "
+ "associated camera has its FOV axis setting set to Horizontal, in which case display will "
+ "be in horizontal degress. Internally, it is always vertical degrees. "
Expand Down Expand Up @@ -114,12 +114,12 @@ public struct PhysicalSettings

/// <summary>The aperture number, in f-stop</summary>
[Tooltip("The aperture number, in f-stop")]
[RangeSlider(Camera.kMinAperture, Camera.kMaxAperture)]
[Range(Camera.kMinAperture, Camera.kMaxAperture)]
public float Aperture;

/// <summary>The number of diaphragm blades</summary>
[Tooltip("The number of diaphragm blades")]
[RangeSlider(Camera.kMinBladeCount, Camera.kMaxBladeCount)]
[Range(Camera.kMinBladeCount, Camera.kMaxBladeCount)]
public int BladeCount;

/// <summary>Maps an aperture range to blade curvature</summary>
Expand All @@ -129,14 +129,14 @@ public struct PhysicalSettings

/// <summary>The strength of the "cat-eye" effect on bokeh (optical vignetting)</summary>
[Tooltip("The strength of the \"cat-eye\" effect on bokeh (optical vignetting)")]
[RangeSlider(0, 1)]
[Range(0, 1)]
public float BarrelClipping;

/// <summary>Stretches the sensor to simulate an anamorphic look. Positive values distort
/// the camera vertically, negative values distore the camera horizontally</summary>
[Tooltip("Stretches the sensor to simulate an anamorphic look. Positive values distort the "
+ "camera vertically, negative values distort the camera horizontally")]
[RangeSlider(-1, 1)]
[Range(-1, 1)]
public float Anamorphism;
}

Expand Down
4 changes: 2 additions & 2 deletions com.unity.cinemachine/Runtime/Core/LookaheadSettings.cs
Expand Up @@ -21,14 +21,14 @@ public struct LookaheadSettings
+ "Note that this setting is sensitive to noisy animation, and can amplify the noise, resulting "
+ "in undesirable jitter. If the camera jitters unacceptably when the target is in motion, "
+ "turn down this setting, or animate the target more smoothly.")]
[RangeSlider(0f, 1f)]
[Range(0f, 1f)]
public float Time;

/// <summary>Controls the smoothness of the lookahead algorithm. Larger values smooth out
/// jittery predictions and also increase prediction lag</summary>
[Tooltip("Controls the smoothness of the lookahead algorithm. Larger values smooth "
+ "out jittery predictions and also increase prediction lag")]
[RangeSlider(0, 30)]
[Range(0, 30)]
public float Smoothing;

/// <summary>If checked, movement along the Y axis will be ignored for lookahead calculations</summary>
Expand Down
2 changes: 1 addition & 1 deletion com.unity.cinemachine/Runtime/Core/TargetTracking.cs
Expand Up @@ -80,7 +80,7 @@ public struct TrackerSettings

/// <summary>How aggressively the camera tries to track the target's rotation.
/// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.</summary>
[RangeSlider(0f, 20f)]
[Range(0f, 20f)]
[Tooltip("How aggressively the camera tries to track the target's rotation. "
+ "Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.")]
public float QuaternionDamping;
Expand Down
Expand Up @@ -45,7 +45,7 @@ public class Cinemachine3rdPersonFollow : CinemachineComponentBase

/// <summary>Specifies which shoulder (left, right, or in-between) the camera is on.</summary>
[Tooltip("Specifies which shoulder (left, right, or in-between) the camera is on")]
[RangeSlider(0, 1)]
[Range(0, 1)]
public float CameraSide;

/// <summary>How far behind the hand the camera will be placed.</summary>
Expand All @@ -71,14 +71,14 @@ public class Cinemachine3rdPersonFollow : CinemachineComponentBase
/// Specifies how close the camera can get to obstacles
/// </summary>
[Tooltip("Specifies how close the camera can get to obstacles")]
[RangeSlider(0, 1)]
[Range(0, 1)]
public float CameraRadius;

/// <summary>
/// How gradually the camera moves to correct for occlusions.
/// Higher numbers will move the camera more gradually.
/// </summary>
[RangeSlider(0, 10)]
[Range(0, 10)]
[Tooltip("How gradually the camera moves to correct for occlusions. " +
"Higher numbers will move the camera more gradually.")]
public float DampingIntoCollision;
Expand All @@ -87,7 +87,7 @@ public class Cinemachine3rdPersonFollow : CinemachineComponentBase
/// How gradually the camera returns to its normal position after having been corrected by the built-in
/// collision resolution system. Higher numbers will move the camera more gradually back to normal.
/// </summary>
[RangeSlider(0, 10)]
[Range(0, 10)]
[Tooltip("How gradually the camera returns to its normal position after having been corrected by the built-in " +
"collision resolution system. Higher numbers will move the camera more gradually back to normal.")]
public float DampingFromCollision;
Expand Down