Skip to content

Commit

Permalink
Add missing tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
glabute committed May 15, 2024
1 parent bce00bd commit 0bc341b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,15 @@ static void OnSplineDataChanged(SplineData<CinemachineSplineRoll.RollData> data)
}

[CustomPropertyDrawer(typeof(DataPoint<CinemachineSplineRoll.RollData>))]
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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
namespace Unity.Cinemachine
{
/// <summary>
/// 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.
/// </summary>
[ExecuteInEditMode]
[DisallowMultipleComponent]
Expand All @@ -24,8 +24,11 @@ public struct RollData
/// <summary>
/// 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.
/// </summary>
[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;

/// <summary> Implicit conversion to float </summary>
Expand All @@ -49,12 +52,9 @@ public struct LerpRollData : IInterpolator<RollData>
/// <summary>
/// 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.
/// </summary>
[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<RollData> Roll;

#if UNITY_EDITOR
Expand Down

0 comments on commit 0bc341b

Please sign in to comment.