diff --git a/com.unity.cinemachine/Editor/PropertyDrawers/RangeSliderPropertyDrawer.cs b/com.unity.cinemachine/Editor/PropertyDrawers/RangeSliderPropertyDrawer.cs deleted file mode 100644 index 05906f2b8..000000000 --- a/com.unity.cinemachine/Editor/PropertyDrawers/RangeSliderPropertyDrawer.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using UnityEditor; -using UnityEditor.UIElements; -using UnityEngine; -using UnityEngine.UIElements; - -namespace Unity.Cinemachine.Editor -{ - [CustomPropertyDrawer(typeof(RangeSliderAttribute))] - class RangeSliderPropertyDrawer : PropertyDrawer - { - // old IMGUI implementation must remain until no more IMGUI inspectors are using it - public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label) - { - var a = attribute as RangeSliderAttribute; - EditorGUI.BeginProperty(rect, label, property); - switch (property.propertyType) - { - case SerializedPropertyType.Float: - { - property.floatValue = EditorGUI.Slider(rect, label, property.floatValue, a.Min, a.Max); - break; - } - case SerializedPropertyType.Integer: - { - property.intValue = EditorGUI.IntSlider(rect, label, property.intValue, (int)a.Min, (int)a.Max); - break; - } - default: - { - Debug.LogError("Use RangeSlider with float or int properties."); - break; - } - } - EditorGUI.EndProperty(); - } - - public override VisualElement CreatePropertyGUI(SerializedProperty property) - { - var a = attribute as RangeSliderAttribute; - var row = new VisualElement { style = { flexDirection = FlexDirection.Row }}; - switch (property.propertyType) - { - case SerializedPropertyType.Float: - { - var slider = new Slider - { - label = property.displayName, - tooltip = property.tooltip, - highValue = a.Max, - lowValue = a.Min, - style = { flexGrow = 4, paddingRight = 4 } - }; - slider.AddToClassList(InspectorUtility.kAlignFieldClass); - slider.BindProperty(property); - row.Add(slider); - var field = new FloatField { label = string.Empty, tooltip = property.tooltip, style = {flexGrow = 1, flexBasis = 0} }; - field.BindProperty(property); - row.Add(field); - break; - } - case SerializedPropertyType.Integer: - { - var slider = new SliderInt - { - label = property.displayName, - tooltip = property.tooltip, - highValue = Mathf.RoundToInt(a.Max), - lowValue = Mathf.RoundToInt(a.Min), - style = { flexGrow = 4, paddingRight = 4 } - }; - slider.AddToClassList(InspectorUtility.kAlignFieldClass); - slider.BindProperty(property); - row.Add(slider); - var field = new IntegerField { label = string.Empty, tooltip = property.tooltip, style = {flexGrow = 1, flexBasis = 0} }; - field.BindProperty(property); - row.Add(field); - break; - } - default: - { - Debug.LogError("Use RangeSlider with float or int properties."); - break; - } - } - return row; - } - } -} diff --git a/com.unity.cinemachine/Editor/PropertyDrawers/RangeSliderPropertyDrawer.cs.meta b/com.unity.cinemachine/Editor/PropertyDrawers/RangeSliderPropertyDrawer.cs.meta deleted file mode 100644 index 8f3160c03..000000000 --- a/com.unity.cinemachine/Editor/PropertyDrawers/RangeSliderPropertyDrawer.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ba179daa5982cd04da4bdd85618d46eb -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.cinemachine/Editor/Utility/CinemachineLensPalette.cs b/com.unity.cinemachine/Editor/Utility/CinemachineLensPalette.cs index 39538eeb3..360f40769 100644 --- a/com.unity.cinemachine/Editor/Utility/CinemachineLensPalette.cs +++ b/com.unity.cinemachine/Editor/Utility/CinemachineLensPalette.cs @@ -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 /// - [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")] diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineConfiner2D.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineConfiner2D.cs index ee05ec153..ac88bb7c2 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineConfiner2D.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineConfiner2D.cs @@ -62,7 +62,7 @@ public class CinemachineConfiner2D : CinemachineExtension /// Damping applied automatically around corners to avoid jumps. [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; diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineDeoccluder.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineDeoccluder.cs index 2f0ece047..b00378d8f 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineDeoccluder.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineDeoccluder.cs @@ -95,7 +95,7 @@ public enum ResolutionStrategy /// Upper limit on how many obstacle hits to process. Higher numbers may impact performance. /// In most environments, 4 is enough. /// - [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; @@ -103,7 +103,7 @@ public enum ResolutionStrategy /// /// Smoothing to apply to obstruction resolution. Nearest camera point is held for at least this long. /// - [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; @@ -111,7 +111,7 @@ public enum ResolutionStrategy /// How gradually the camera returns to its normal position after having been corrected. /// Higher numbers will move the camera more gradually back to normal. /// - [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; @@ -120,7 +120,7 @@ public enum ResolutionStrategy /// How gradually the camera moves to resolve an occlusion. /// Higher numbers will move the camera more gradually. /// - [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; diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineFollowZoom.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineFollowZoom.cs index 5bcf04753..4130e6622 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineFollowZoom.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineFollowZoom.cs @@ -24,7 +24,7 @@ public class CinemachineFollowZoom : CinemachineExtension /// 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. - [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")] diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineGroupFraming.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineGroupFraming.cs index f7cedc11e..022177564 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineGroupFraming.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineGroupFraming.cs @@ -33,7 +33,7 @@ public enum FramingModes /// How much of the screen to fill with the bounding box of the targets. [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; /// A nonzero value will offset the group in the camera frame. @@ -42,7 +42,7 @@ public enum FramingModes /// How aggressively the camera tries to frame the group. /// Small numbers are more responsive - [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.")] diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineRecomposer.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineRecomposer.cs index d8202f5a6..a7457016c 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineRecomposer.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineRecomposer.cs @@ -52,7 +52,7 @@ public class CinemachineRecomposer : CinemachineExtension /// /// Lowering this value relaxes the camera's attention to the Follow target (normal = 1) /// - [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; @@ -60,7 +60,7 @@ public class CinemachineRecomposer : CinemachineExtension /// /// Lowering this value relaxes the camera's attention to the LookAt target (normal = 1) /// - [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; diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineStoryboard.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineStoryboard.cs index 9d1ddae64..dc6157d87 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineStoryboard.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineStoryboard.cs @@ -58,7 +58,7 @@ public enum FillStrategy /// [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; /// @@ -99,7 +99,7 @@ public enum FillStrategy /// /// Wipe the image on and off horizontally /// - [RangeSlider(-1, 1)] + [Range(-1, 1)] [Tooltip("Wipe the image on and off horizontally")] [FormerlySerializedAs("m_SplitView")] public float SplitView = 0f; diff --git a/com.unity.cinemachine/Runtime/Components/CinemachineOrbitalFollow.cs b/com.unity.cinemachine/Runtime/Components/CinemachineOrbitalFollow.cs index 0d42119d7..056c922cd 100644 --- a/com.unity.cinemachine/Runtime/Components/CinemachineOrbitalFollow.cs +++ b/com.unity.cinemachine/Runtime/Components/CinemachineOrbitalFollow.cs @@ -518,7 +518,7 @@ public struct Settings /// determines final placement on the Y axis [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; /// Default orbit rig diff --git a/com.unity.cinemachine/Runtime/Components/CinemachineSplineDolly.cs b/com.unity.cinemachine/Runtime/Components/CinemachineSplineDolly.cs index 9af748d25..3340beacb 100644 --- a/com.unity.cinemachine/Runtime/Components/CinemachineSplineDolly.cs +++ b/com.unity.cinemachine/Runtime/Components/CinemachineSplineDolly.cs @@ -105,7 +105,7 @@ public struct DampingSettings /// How aggressively the camera tries to maintain the desired rotation. /// This is only used if Camera Rotation is not Default. - [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; diff --git a/com.unity.cinemachine/Runtime/Components/CinemachineThirdPersonFollow.cs b/com.unity.cinemachine/Runtime/Components/CinemachineThirdPersonFollow.cs index fd545278a..146c123b7 100644 --- a/com.unity.cinemachine/Runtime/Components/CinemachineThirdPersonFollow.cs +++ b/com.unity.cinemachine/Runtime/Components/CinemachineThirdPersonFollow.cs @@ -44,7 +44,7 @@ public class CinemachineThirdPersonFollow : CinemachineComponentBase /// Specifies which shoulder (left, right, or in-between) the camera is on. [Tooltip("Specifies which shoulder (left, right, or in-between) the camera is on")] - [RangeSlider(0, 1)] + [Range(0, 1)] public float CameraSide; /// How far behind the hand the camera will be placed. @@ -80,14 +80,14 @@ public struct ObstacleSettings /// Specifies how close the camera can get to obstacles /// [Tooltip("Specifies how close the camera can get to obstacles")] - [RangeSlider(0, 1)] + [Range(0, 1)] public float CameraRadius; /// /// How gradually the camera moves to correct for occlusions. /// Higher numbers will move the camera more gradually. /// - [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; @@ -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. /// - [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; diff --git a/com.unity.cinemachine/Runtime/Core/CinemachinePropertyAttribute.cs b/com.unity.cinemachine/Runtime/Core/CinemachinePropertyAttribute.cs index b7e23c1ee..bc4a87878 100644 --- a/com.unity.cinemachine/Runtime/Core/CinemachinePropertyAttribute.cs +++ b/com.unity.cinemachine/Runtime/Core/CinemachinePropertyAttribute.cs @@ -56,6 +56,7 @@ public EnabledPropertyAttribute(string enabledProperty = "Enabled", string toggl /// /// Property applied to int or float fields to generate a slider in the inspector. /// + [Obsolete("Use RangeAttribute instead")] public sealed class RangeSliderAttribute : PropertyAttribute { /// Minimum value for the range slider diff --git a/com.unity.cinemachine/Runtime/Core/LensSettings.cs b/com.unity.cinemachine/Runtime/Core/LensSettings.cs index 19c45fe9a..03301b768 100644 --- a/com.unity.cinemachine/Runtime/Core/LensSettings.cs +++ b/com.unity.cinemachine/Runtime/Core/LensSettings.cs @@ -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. /// - [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. " @@ -114,12 +114,12 @@ public struct PhysicalSettings /// The aperture number, in f-stop [Tooltip("The aperture number, in f-stop")] - [RangeSlider(Camera.kMinAperture, Camera.kMaxAperture)] + [Range(Camera.kMinAperture, Camera.kMaxAperture)] public float Aperture; /// The number of diaphragm blades [Tooltip("The number of diaphragm blades")] - [RangeSlider(Camera.kMinBladeCount, Camera.kMaxBladeCount)] + [Range(Camera.kMinBladeCount, Camera.kMaxBladeCount)] public int BladeCount; /// Maps an aperture range to blade curvature @@ -129,14 +129,14 @@ public struct PhysicalSettings /// The strength of the "cat-eye" effect on bokeh (optical vignetting) [Tooltip("The strength of the \"cat-eye\" effect on bokeh (optical vignetting)")] - [RangeSlider(0, 1)] + [Range(0, 1)] public float BarrelClipping; /// Stretches the sensor to simulate an anamorphic look. Positive values distort /// the camera vertically, negative values distore the camera horizontally [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; } diff --git a/com.unity.cinemachine/Runtime/Core/LookaheadSettings.cs b/com.unity.cinemachine/Runtime/Core/LookaheadSettings.cs index bce9c9cda..db8fc2033 100644 --- a/com.unity.cinemachine/Runtime/Core/LookaheadSettings.cs +++ b/com.unity.cinemachine/Runtime/Core/LookaheadSettings.cs @@ -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; /// Controls the smoothness of the lookahead algorithm. Larger values smooth out /// jittery predictions and also increase prediction lag [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; /// If checked, movement along the Y axis will be ignored for lookahead calculations diff --git a/com.unity.cinemachine/Runtime/Core/TargetTracking.cs b/com.unity.cinemachine/Runtime/Core/TargetTracking.cs index cbda98736..6592955c4 100644 --- a/com.unity.cinemachine/Runtime/Core/TargetTracking.cs +++ b/com.unity.cinemachine/Runtime/Core/TargetTracking.cs @@ -80,7 +80,7 @@ public struct TrackerSettings /// 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. - [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; diff --git a/com.unity.cinemachine/Runtime/Deprecated/Cinemachine3rdPersonFollow.cs b/com.unity.cinemachine/Runtime/Deprecated/Cinemachine3rdPersonFollow.cs index 43b4e9279..9c499af07 100644 --- a/com.unity.cinemachine/Runtime/Deprecated/Cinemachine3rdPersonFollow.cs +++ b/com.unity.cinemachine/Runtime/Deprecated/Cinemachine3rdPersonFollow.cs @@ -45,7 +45,7 @@ public class Cinemachine3rdPersonFollow : CinemachineComponentBase /// Specifies which shoulder (left, right, or in-between) the camera is on. [Tooltip("Specifies which shoulder (left, right, or in-between) the camera is on")] - [RangeSlider(0, 1)] + [Range(0, 1)] public float CameraSide; /// How far behind the hand the camera will be placed. @@ -71,14 +71,14 @@ public class Cinemachine3rdPersonFollow : CinemachineComponentBase /// Specifies how close the camera can get to obstacles /// [Tooltip("Specifies how close the camera can get to obstacles")] - [RangeSlider(0, 1)] + [Range(0, 1)] public float CameraRadius; /// /// How gradually the camera moves to correct for occlusions. /// Higher numbers will move the camera more gradually. /// - [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; @@ -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. /// - [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; diff --git a/com.unity.cinemachine/Runtime/Deprecated/CinemachineComposer.cs b/com.unity.cinemachine/Runtime/Deprecated/CinemachineComposer.cs index 810ce2fe9..cb71679b3 100644 --- a/com.unity.cinemachine/Runtime/Deprecated/CinemachineComposer.cs +++ b/com.unity.cinemachine/Runtime/Deprecated/CinemachineComposer.cs @@ -33,14 +33,14 @@ public class CinemachineComposer : CinemachineComponentBase + "many seconds into the future. Note that this setting is sensitive to noisy animation, and " + "can amplify the noise, resulting in undesirable camera 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 m_LookaheadTime = 0; /// Controls the smoothness of the lookahead algorithm. Larger values smooth out /// jittery predictions and also increase prediction lag [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 m_LookaheadSmoothing = 0; /// If checked, movement along the Y axis will be ignored for lookahead calculations @@ -52,7 +52,7 @@ public class CinemachineComposer : CinemachineComponentBase /// the dead zone. Larger numbers give a more heavy slowly responding camera. /// Using different vertical and horizontal settings can yield a wide range of camera behaviors. [Space] - [RangeSlider(0f, 20)] + [Range(0f, 20)] [Tooltip("How aggressively the camera tries to follow the target in the screen-horizontal direction. " + "Small numbers are more responsive, rapidly orienting the camera to keep the target in " + "the dead zone. Larger numbers give a more heavy slowly responding camera. Using different " @@ -63,7 +63,7 @@ public class CinemachineComposer : CinemachineComponentBase /// Small numbers are more responsive, rapidly orienting the camera to keep the target in /// the dead zone. Larger numbers give a more heavy slowly responding camera. Using different vertical /// and horizontal settings can yield a wide range of camera behaviors. - [RangeSlider(0f, 20)] + [Range(0f, 20)] [Tooltip("How aggressively the camera tries to follow the target in the screen-vertical direction. " + "Small numbers are more responsive, rapidly orienting the camera to keep the target in " + "the dead zone. Larger numbers give a more heavy slowly responding camera. Using different " @@ -72,46 +72,46 @@ public class CinemachineComposer : CinemachineComponentBase /// Horizontal screen position for target. The camera will rotate to the position the tracked object here [Space] - [RangeSlider(-0.5f, 1.5f)] + [Range(-0.5f, 1.5f)] [Tooltip("Horizontal screen position for target. The camera will rotate to position the tracked object here.")] public float m_ScreenX = 0.5f; /// Vertical screen position for target, The camera will rotate to to position the tracked object here - [RangeSlider(-0.5f, 1.5f)] + [Range(-0.5f, 1.5f)] [Tooltip("Vertical screen position for target, The camera will rotate to position the tracked object here.")] public float m_ScreenY = 0.5f; /// Camera will not rotate horizontally if the target is within this range of the position - [RangeSlider(0f, 2f)] + [Range(0f, 2f)] [Tooltip("Camera will not rotate horizontally if the target is within this range of the position.")] public float m_DeadZoneWidth = 0f; /// Camera will not rotate vertically if the target is within this range of the position - [RangeSlider(0f, 2f)] + [Range(0f, 2f)] [Tooltip("Camera will not rotate vertically if the target is within this range of the position.")] public float m_DeadZoneHeight = 0f; /// When target is within this region, camera will gradually move to re-align /// towards the desired position, depending onm the damping speed - [RangeSlider(0f, 2f)] + [Range(0f, 2f)] [Tooltip("When target is within this region, camera will gradually rotate horizontally to re-align " + "towards the desired position, depending on the damping speed.")] public float m_SoftZoneWidth = 0.8f; /// When target is within this region, camera will gradually move to re-align /// towards the desired position, depending onm the damping speed - [RangeSlider(0f, 2f)] + [Range(0f, 2f)] [Tooltip("When target is within this region, camera will gradually rotate vertically to re-align " + "towards the desired position, depending on the damping speed.")] public float m_SoftZoneHeight = 0.8f; /// A non-zero bias will move the targt position away from the center of the soft zone - [RangeSlider(-0.5f, 0.5f)] + [Range(-0.5f, 0.5f)] [Tooltip("A non-zero bias will move the target position horizontally away from the center of the soft zone.")] public float m_BiasX = 0f; /// A non-zero bias will move the targt position away from the center of the soft zone - [RangeSlider(-0.5f, 0.5f)] + [Range(-0.5f, 0.5f)] [Tooltip("A non-zero bias will move the target position vertically away from the center of the soft zone.")] public float m_BiasY = 0f; diff --git a/com.unity.cinemachine/Runtime/Deprecated/CinemachineConfiner.cs b/com.unity.cinemachine/Runtime/Deprecated/CinemachineConfiner.cs index 78593b307..ba4121127 100644 --- a/com.unity.cinemachine/Runtime/Deprecated/CinemachineConfiner.cs +++ b/com.unity.cinemachine/Runtime/Deprecated/CinemachineConfiner.cs @@ -53,7 +53,7 @@ public enum Mode /// How gradually to return the camera to the bounding volume if it goes beyond the borders [Tooltip("How gradually to return the camera to the bounding volume if it goes beyond the borders. " + "Higher numbers are more gradual.")] - [RangeSlider(0, 10)] + [Range(0, 10)] public float m_Damping = 0; diff --git a/com.unity.cinemachine/Runtime/Deprecated/CinemachineFramingTransposer.cs b/com.unity.cinemachine/Runtime/Deprecated/CinemachineFramingTransposer.cs index 69172bf12..50ee58e41 100644 --- a/com.unity.cinemachine/Runtime/Deprecated/CinemachineFramingTransposer.cs +++ b/com.unity.cinemachine/Runtime/Deprecated/CinemachineFramingTransposer.cs @@ -37,7 +37,7 @@ public class CinemachineFramingTransposer : CinemachineComponentBase + "animation, and can amplify the noise, resulting in undesirable camera 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)] [Space] public float m_LookaheadTime = 0; @@ -45,7 +45,7 @@ public class CinemachineFramingTransposer : CinemachineComponentBase /// jittery predictions and also increase prediction lag [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 m_LookaheadSmoothing = 0; /// If checked, movement along the Y axis will be ignored for lookahead calculations @@ -57,7 +57,7 @@ public class CinemachineFramingTransposer : CinemachineComponentBase /// x-axis offset. Larger numbers give a more heavy slowly responding camera. /// Using different settings per axis can yield a wide range of camera behaviors [Space] - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to maintain the offset in the X-axis. " + "Small numbers are more responsive, rapidly translating the camera to keep the target's " + "x-axis offset. Larger numbers give a more heavy slowly responding camera. " @@ -68,7 +68,7 @@ public class CinemachineFramingTransposer : CinemachineComponentBase /// Small numbers are more responsive, rapidly translating the camera to keep the target's /// y-axis offset. Larger numbers give a more heavy slowly responding camera. /// Using different settings per axis can yield a wide range of camera behaviors - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to maintain the offset in the Y-axis. " + "Small numbers are more responsive, rapidly translating the camera to keep the target's " + "y-axis offset. Larger numbers give a more heavy slowly responding camera. " @@ -79,7 +79,7 @@ public class CinemachineFramingTransposer : CinemachineComponentBase /// Small numbers are more responsive, rapidly translating the camera to keep the /// target's z-axis offset. Larger numbers give a more heavy slowly responding camera. /// Using different settings per axis can yield a wide range of camera behaviors - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to maintain the offset in the Z-axis. " + "Small numbers are more responsive, rapidly translating the camera to keep the target's " + "z-axis offset. Larger numbers give a more heavy slowly responding camera. " @@ -95,12 +95,12 @@ public class CinemachineFramingTransposer : CinemachineComponentBase /// Horizontal screen position for target. The camera will move to position the tracked object here [Space] - [RangeSlider(-0.5f, 1.5f)] + [Range(-0.5f, 1.5f)] [Tooltip("Horizontal screen position for target. The camera will move to position the tracked object here.")] public float m_ScreenX = 0.5f; /// Vertical screen position for target, The camera will move to to position the tracked object here - [RangeSlider(-0.5f, 1.5f)] + [Range(-0.5f, 1.5f)] [Tooltip("Vertical screen position for target, The camera will move to position the tracked object here.")] public float m_ScreenY = 0.5f; @@ -110,12 +110,12 @@ public class CinemachineFramingTransposer : CinemachineComponentBase /// Camera will not move horizontally if the target is within this range of the position [Space] - [RangeSlider(0f, 2f)] + [Range(0f, 2f)] [Tooltip("Camera will not move horizontally if the target is within this range of the position.")] public float m_DeadZoneWidth = 0f; /// Camera will not move vertically if the target is within this range of the position - [RangeSlider(0f, 2f)] + [Range(0f, 2f)] [Tooltip("Camera will not move vertically if the target is within this range of the position.")] public float m_DeadZoneHeight = 0f; @@ -133,25 +133,25 @@ public class CinemachineFramingTransposer : CinemachineComponentBase /// When target is within this region, camera will gradually move to re-align /// towards the desired position, depending onm the damping speed - [RangeSlider(0f, 2f)] + [Range(0f, 2f)] [Tooltip("When target is within this region, camera will gradually move horizontally to " + "re-align towards the desired position, depending on the damping speed.")] public float m_SoftZoneWidth = 0.8f; /// When target is within this region, camera will gradually move to re-align /// towards the desired position, depending onm the damping speed - [RangeSlider(0f, 2f)] + [Range(0f, 2f)] [Tooltip("When target is within this region, camera will gradually move vertically to " + "re-align towards the desired position, depending on the damping speed.")] public float m_SoftZoneHeight = 0.8f; /// A non-zero bias will move the targt position away from the center of the soft zone - [RangeSlider(-0.5f, 0.5f)] + [Range(-0.5f, 0.5f)] [Tooltip("A non-zero bias will move the target position horizontally away from the center of the soft zone.")] public float m_BiasX = 0f; /// A non-zero bias will move the targt position away from the center of the soft zone - [RangeSlider(-0.5f, 0.5f)] + [Range(-0.5f, 0.5f)] [Tooltip("A non-zero bias will move the target position vertically away from the center of the soft zone.")] public float m_BiasY = 0f; @@ -218,12 +218,12 @@ public enum AdjustmentMode public float m_MaximumDistance = 5000f; /// If adjusting FOV, will not set the FOV lower than this - [RangeSlider(1, 179)] + [Range(1, 179)] [Tooltip("If adjusting FOV, will not set the FOV lower than this.")] public float m_MinimumFOV = 3; /// If adjusting FOV, will not set the FOV higher than this - [RangeSlider(1, 179)] + [Range(1, 179)] [Tooltip("If adjusting FOV, will not set the FOV higher than this.")] public float m_MaximumFOV = 60; diff --git a/com.unity.cinemachine/Runtime/Deprecated/CinemachineFreeLook.cs b/com.unity.cinemachine/Runtime/Deprecated/CinemachineFreeLook.cs index a458c2654..d51c41174 100644 --- a/com.unity.cinemachine/Runtime/Deprecated/CinemachineFreeLook.cs +++ b/com.unity.cinemachine/Runtime/Deprecated/CinemachineFreeLook.cs @@ -93,7 +93,7 @@ public TargetTracking.BindingMode m_BindingMode /// [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)] [FormerlySerializedAs("m_SplineTension")] public float m_SplineCurvature = 0.2f; diff --git a/com.unity.cinemachine/Runtime/Deprecated/CinemachineGroupComposer.cs b/com.unity.cinemachine/Runtime/Deprecated/CinemachineGroupComposer.cs index 012ccb63f..d85de572c 100644 --- a/com.unity.cinemachine/Runtime/Deprecated/CinemachineGroupComposer.cs +++ b/com.unity.cinemachine/Runtime/Deprecated/CinemachineGroupComposer.cs @@ -34,7 +34,7 @@ public enum FramingMode /// How aggressively the camera tries to frame the group. /// Small numbers are more responsive - [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.")] @@ -73,12 +73,12 @@ public enum AdjustmentMode public float m_MaximumDistance = 5000f; /// If adjusting FOV, will not set the FOV lower than this - [RangeSlider(1, 179)] + [Range(1, 179)] [Tooltip("If adjusting FOV, will not set the FOV lower than this.")] public float m_MinimumFOV = 3; /// If adjusting FOV, will not set the FOV higher than this - [RangeSlider(1, 179)] + [Range(1, 179)] [Tooltip("If adjusting FOV, will not set the FOV higher than this.")] public float m_MaximumFOV = 60; diff --git a/com.unity.cinemachine/Runtime/Deprecated/CinemachineOrbitalTransposer.cs b/com.unity.cinemachine/Runtime/Deprecated/CinemachineOrbitalTransposer.cs index bc84698dd..0493d4a6a 100644 --- a/com.unity.cinemachine/Runtime/Deprecated/CinemachineOrbitalTransposer.cs +++ b/com.unity.cinemachine/Runtime/Deprecated/CinemachineOrbitalTransposer.cs @@ -181,7 +181,7 @@ public enum HeadingDefinition /// Size of the velocity sampling window for target heading filter. /// Used only if deriving heading from target's movement - [RangeSlider(0, 10)] + [Range(0, 10)] [Tooltip("Size of the velocity sampling window for target heading filter. This filters out " + "irregularities in the target's movement. Used only if deriving heading from target's " + "movement (PositionDelta or Velocity)")] @@ -189,7 +189,7 @@ public enum HeadingDefinition /// Additional Y rotation applied to the target heading. /// When this value is 0, the camera will be placed behind the target - [RangeSlider(-180f, 180f)] + [Range(-180f, 180f)] [FormerlySerializedAs("m_HeadingBias")] [Tooltip("Where the camera is placed when the X-axis value is zero. This is a rotation in " + "degrees around the Y axis. When this value is 0, the camera will be placed behind " diff --git a/com.unity.cinemachine/Runtime/Deprecated/CinemachinePathBase.cs b/com.unity.cinemachine/Runtime/Deprecated/CinemachinePathBase.cs index b638b45fe..328e1f650 100644 --- a/com.unity.cinemachine/Runtime/Deprecated/CinemachinePathBase.cs +++ b/com.unity.cinemachine/Runtime/Deprecated/CinemachinePathBase.cs @@ -12,7 +12,7 @@ public abstract class CinemachinePathBase : MonoBehaviour { /// Path samples per waypoint [Tooltip("Path samples per waypoint. This is used for calculating path distances.")] - [RangeSlider(1, 100)] + [Range(1, 100)] public int m_Resolution = 20; /// This class holds the settings that control how the path @@ -27,7 +27,7 @@ public abstract class CinemachinePathBase : MonoBehaviour public Color inactivePathColor = Color.gray; /// The width of the railroad-tracks that are drawn to represent the path [Tooltip("The width of the railroad-tracks that are drawn to represent the path")] - [RangeSlider(0f, 10f)] + [Range(0f, 10f)] public float width = 0.2f; } /// The settings that control how the path diff --git a/com.unity.cinemachine/Runtime/Deprecated/CinemachineTrackedDolly.cs b/com.unity.cinemachine/Runtime/Deprecated/CinemachineTrackedDolly.cs index 8c9e06a52..999822efb 100644 --- a/com.unity.cinemachine/Runtime/Deprecated/CinemachineTrackedDolly.cs +++ b/com.unity.cinemachine/Runtime/Deprecated/CinemachineTrackedDolly.cs @@ -45,7 +45,7 @@ public class CinemachineTrackedDolly : CinemachineComponentBase /// Small numbers are more responsive, rapidly translating the camera to keep the target's /// x-axis offset. Larger numbers give a more heavy slowly responding camera. /// Using different settings per axis can yield a wide range of camera behaviors - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to maintain its position in a direction " + "perpendicular to the path. Small numbers are more responsive, rapidly translating " + "the camera to keep the target's x-axis offset. Larger numbers give a more heavy " @@ -57,7 +57,7 @@ public class CinemachineTrackedDolly : CinemachineComponentBase /// Small numbers are more responsive, rapidly translating the camera to keep the target's /// y-axis offset. Larger numbers give a more heavy slowly responding camera. /// Using different settings per axis can yield a wide range of camera behaviors - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to maintain its position in the path-local up direction. " + "Small numbers are more responsive, rapidly translating the camera to keep the target's " + "y-axis offset. Larger numbers give a more heavy slowly responding camera. Using different " @@ -68,7 +68,7 @@ public class CinemachineTrackedDolly : CinemachineComponentBase /// Small numbers are more responsive, rapidly translating the camera to keep the /// target's z-axis offset. Larger numbers give a more heavy slowly responding camera. /// Using different settings per axis can yield a wide range of camera behaviors - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to maintain its position in a direction parallel to the path. " + "Small numbers are more responsive, rapidly translating the camera to keep the target's z-axis offset. " + "Larger numbers give a more heavy slowly responding camera. Using different settings per axis " @@ -97,21 +97,21 @@ public enum CameraUpMode /// "How aggressively the camera tries to track the target rotation's X angle. /// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera. - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to track the target rotation's X angle. Small numbers are " + "more responsive. Larger numbers give a more heavy slowly responding camera.")] public float m_PitchDamping = 0; /// How aggressively the camera tries to track the target rotation's Y angle. /// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera. - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to track the target rotation's Y angle. Small numbers are " + "more responsive. Larger numbers give a more heavy slowly responding camera.")] public float m_YawDamping = 0; /// How aggressively the camera tries to track the target rotation's Z angle. /// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera. - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to track the target rotation's Z angle. Small numbers " + "are more responsive. Larger numbers give a more heavy slowly responding camera.")] public float m_RollDamping = 0f; diff --git a/com.unity.cinemachine/Runtime/Deprecated/CinemachineTransposer.cs b/com.unity.cinemachine/Runtime/Deprecated/CinemachineTransposer.cs index 32a172606..797d21563 100644 --- a/com.unity.cinemachine/Runtime/Deprecated/CinemachineTransposer.cs +++ b/com.unity.cinemachine/Runtime/Deprecated/CinemachineTransposer.cs @@ -27,7 +27,7 @@ public class CinemachineTransposer : CinemachineComponentBase /// Small numbers are more responsive, rapidly translating the camera to keep the target's /// x-axis offset. Larger numbers give a more heavy slowly responding camera. /// Using different settings per axis can yield a wide range of camera behaviors - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to maintain the offset in the X-axis. Small numbers " + "are more responsive, rapidly translating the camera to keep the target's x-axis offset. " + "Larger numbers give a more heavy slowly responding camera. Using different settings per " @@ -38,7 +38,7 @@ public class CinemachineTransposer : CinemachineComponentBase /// Small numbers are more responsive, rapidly translating the camera to keep the target's /// y-axis offset. Larger numbers give a more heavy slowly responding camera. /// Using different settings per axis can yield a wide range of camera behaviors - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to maintain the offset in the Y-axis. Small numbers " + "are more responsive, rapidly translating the camera to keep the target's y-axis offset. " + "Larger numbers give a more heavy slowly responding camera. Using different settings per " @@ -49,7 +49,7 @@ public class CinemachineTransposer : CinemachineComponentBase /// Small numbers are more responsive, rapidly translating the camera to keep the /// target's z-axis offset. Larger numbers give a more heavy slowly responding camera. /// Using different settings per axis can yield a wide range of camera behaviors - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to maintain the offset in the Z-axis. " + "Small numbers are more responsive, rapidly translating the camera to keep the " + "target's z-axis offset. Larger numbers give a more heavy slowly responding camera. " @@ -63,28 +63,28 @@ public class CinemachineTransposer : CinemachineComponentBase /// How aggressively the camera tries to track the target rotation's X angle. /// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera. - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to track the target rotation's X angle. " + "Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.")] public float m_PitchDamping = 0; /// How aggressively the camera tries to track the target rotation's Y angle. /// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera. - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to track the target rotation's Y angle. " + "Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.")] public float m_YawDamping = 0; /// How aggressively the camera tries to track the target rotation's Z angle. /// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera. - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to track the target rotation's Z angle. " + "Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.")] public float m_RollDamping = 0f; /// How aggressively the camera tries to track the target's orientation. /// Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera. - [RangeSlider(0f, 20f)] + [Range(0f, 20f)] [Tooltip("How aggressively the camera tries to track the target's orientation. " + "Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.")] public float m_AngularDamping = 0f; diff --git a/com.unity.cinemachine/Runtime/Impulse/CinemachineImpulseDefinition.cs b/com.unity.cinemachine/Runtime/Impulse/CinemachineImpulseDefinition.cs index d67965d26..d1aab9ece 100644 --- a/com.unity.cinemachine/Runtime/Impulse/CinemachineImpulseDefinition.cs +++ b/com.unity.cinemachine/Runtime/Impulse/CinemachineImpulseDefinition.cs @@ -105,7 +105,7 @@ public enum ImpulseTypes /// [Tooltip("This defines how the widely signal will spread within the effect radius before " + "dissipating with distance from the impact point")] - [RangeSlider(0,1)] + [Range(0,1)] [FormerlySerializedAs("m_DissipationRate")] public float DissipationRate; diff --git a/com.unity.cinemachine/Runtime/PostProcessing/CinemachineAutoFocus.cs b/com.unity.cinemachine/Runtime/PostProcessing/CinemachineAutoFocus.cs index f92a153e4..e800a6ff2 100644 --- a/com.unity.cinemachine/Runtime/PostProcessing/CinemachineAutoFocus.cs +++ b/com.unity.cinemachine/Runtime/PostProcessing/CinemachineAutoFocus.cs @@ -71,7 +71,7 @@ public enum FocusTrackingMode /// [Tooltip("Radius of the AutoFocus sensor in the center of the screen. A value of 1 would fill the screen. " + "It's recommended to keep this quite small. Default value is 0.02")] - [RangeSlider(0, 0.1f)] + [Range(0, 0.1f)] public float AutoDetectionRadius; CustomPassVolume m_CustomPassVolume; diff --git a/com.unity.cinemachine/Runtime/PostProcessing/FocusDistance.cs b/com.unity.cinemachine/Runtime/PostProcessing/FocusDistance.cs index 5833eda47..8dfe87a2e 100644 --- a/com.unity.cinemachine/Runtime/PostProcessing/FocusDistance.cs +++ b/com.unity.cinemachine/Runtime/PostProcessing/FocusDistance.cs @@ -16,16 +16,16 @@ static class Uniforms [Tooltip("Stickier auto focus is more stable (less switching back and forth as tiny " + "grass blades cross the camera), but requires looking at a bigger uniform-ish area to switch focus to it.")] - [RangeSlider(0, 1)] + [Range(0, 1)] public float Stickiness = 0.4f; [Tooltip("Radius of the FocusDistance sensor in the center of the screen. A value of 1 would fill the screen. " + "It's recommended to keep this quite small. Default value is 0.02")] - [RangeSlider(0, 1)] + [Range(0, 1)] public float KernelRadius = 0.02f; [Tooltip("Depth tolerance for inclusion in the same depth bucket. Effectively the depth resolution.")] - [RangeSlider(0, 1)] + [Range(0, 1)] public float DepthTolerance = 0.02f; [Tooltip("Position on the screen of the depth sensor. (0, 0) is screen center.")]