Hello,
I’m trying to modify the TransformTween playable. I would like the clip duration to be automatically modified depending on the distance between de start location and the end location.
I added these lines at the end of TransformTweenDrawer.cs
TransformTweenClip clip = property.serializedObject.targetObject as TransformTweenClip;
SerializedObject editorGUI = new SerializedObject(Selection.activeObject);
SerializedProperty duration = editorGUI.FindProperty("m_Clip.m_Duration");
// duration.doubleValue = 3f;
duration.doubleValue= Vector3.Distance(clip.startLocation.position, clip.endLocation.position);
editorGUI.ApplyModifiedProperties();
I get an error ‘ExposedReference’ does not contain a definition for ‘position’…
I think it’s because startLocation and endLocation are ExposedReference but I have no idea how to handle them.
Thank for your help