From 0bc341bacf3f015076dd5c47ab75dff1e609c8d1 Mon Sep 17 00:00:00 2001 From: Gregory Labute Date: Wed, 15 May 2024 12:23:03 -0400 Subject: [PATCH] Add missing tooltips --- .../Editors/CinemachineSplineRollEditor.cs | 7 +++++-- .../Runtime/Behaviours/CinemachineSplineRoll.cs | 16 ++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/com.unity.cinemachine/Editor/Editors/CinemachineSplineRollEditor.cs b/com.unity.cinemachine/Editor/Editors/CinemachineSplineRollEditor.cs index 2724a4f60..5da9a2420 100644 --- a/com.unity.cinemachine/Editor/Editors/CinemachineSplineRollEditor.cs +++ b/com.unity.cinemachine/Editor/Editors/CinemachineSplineRollEditor.cs @@ -152,12 +152,15 @@ static void OnSplineDataChanged(SplineData data) } [CustomPropertyDrawer(typeof(DataPoint))] - class CinemachineLookAtDataOnSplineItemPropertyDrawer : PropertyDrawer + class CinemachineLookAtDataOnSplineDataPointPropertyDrawer : PropertyDrawer { public override VisualElement CreatePropertyGUI(SerializedProperty property) { + const string indexTooltip = "The position on the Spline at which this data point will take effect. " + + "The value is interpreted according to the Index Unit setting."; + var ux = new VisualElement { style = { flexDirection = FlexDirection.Row }}; - ux.Add(new InspectorUtility.CompactPropertyField(property.FindPropertyRelative("m_Index"))); + ux.Add(new InspectorUtility.CompactPropertyField(property.FindPropertyRelative("m_Index")) { tooltip = indexTooltip }); var def = new CinemachineSplineRoll.RollData(); var valueProp = property.FindPropertyRelative("m_Value"); diff --git a/com.unity.cinemachine/Runtime/Behaviours/CinemachineSplineRoll.cs b/com.unity.cinemachine/Runtime/Behaviours/CinemachineSplineRoll.cs index 8e01da234..f8108ff73 100644 --- a/com.unity.cinemachine/Runtime/Behaviours/CinemachineSplineRoll.cs +++ b/com.unity.cinemachine/Runtime/Behaviours/CinemachineSplineRoll.cs @@ -5,11 +5,11 @@ namespace Unity.Cinemachine { /// - /// Extension that can be added to a SplineContainer or a vcam that uses a SplineContainer, for example a vcam + /// 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 vcam that reads that SplineContainer globally. - /// - When CinemachineSplineRoll is added to a vcam, then roll only affects that vcam locally. + /// 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. /// [ExecuteInEditMode] [DisallowMultipleComponent] @@ -24,8 +24,11 @@ public struct RollData /// /// 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 vcam, this is going to be a local override that only affects that vcam. + /// When placed on a CinemachineCamera, this is going to be a local override that only affects that CinemachineCamera. /// + [Tooltip("Roll (in degrees) around the forward direction for specific location on the track.\n" + + "- When placed on a SplineContainer, this is going to be a global override that affects all vcams using the Spline.\n" + + "- When placed on a CinemachineCamera, this is going to be a local override that only affects that CinemachineCamera.")] public float Value; /// Implicit conversion to float @@ -49,12 +52,9 @@ public struct LerpRollData : IInterpolator /// /// 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 vcam, this is going to be a local override that only affects that vcam. + /// When placed on a CinemachineCamera, this is going to be a local override that only affects that CinemachineCamera. /// [HideFoldout] - [Tooltip("Roll (in degrees) around the forward direction for specific location on the track.\n" + - "- When placed on a SplineContainer, this is going to be a global override that affects all vcams using the Spline.\n" + - "- When placed on a vcam, this is going to be a local override that only affects that vcam.")] public SplineData Roll; #if UNITY_EDITOR