private static bool InternalAddParameter(TimelineClip clip, string parameterName, ref EditorCurveBinding binding, out SerializedProperty property)
        {
            property = null;
            bool result;

            if (clip.IsParameterAnimated(parameterName))
            {
                result = false;
            }
            else
            {
                SerializedObject serializedObject = AnimatedParameterExtensions.GetSerializedObject(clip);
                if (serializedObject == null)
                {
                    result = false;
                }
                else
                {
                    property = serializedObject.FindProperty(parameterName);
                    if (property == null || !AnimatedParameterExtensions.IsAnimatable(property.get_propertyType()))
                    {
                        result = false;
                    }
                    else
                    {
                        AnimatedParameterExtensions.CreateCurvesIfRequired(clip, null);
                        binding = clip.GetCurveBinding(parameterName);
                        result  = true;
                    }
                }
            }
            return(result);
        }
        public static bool IsParameterAnimatable(this TimelineClip clip, string parameterName)
        {
            bool result;

            if (clip.asset == null || Attribute.IsDefined(clip.asset.GetType(), typeof(NotKeyableAttribute)))
            {
                result = false;
            }
            else if (!clip.HasScriptPlayable())
            {
                result = false;
            }
            else
            {
                SerializedObject serializedObject = AnimatedParameterExtensions.GetSerializedObject(clip);
                if (serializedObject == null)
                {
                    result = false;
                }
                else
                {
                    bool flag = clip.asset is IPlayableBehaviour;
                    SerializedProperty serializedProperty = serializedObject.FindProperty(parameterName);
                    result = (serializedProperty != null && AnimatedParameterExtensions.IsAnimatable(serializedProperty.get_propertyType()) && AnimatedParameterExtensions.IsKeyable(clip.asset.GetType(), parameterName) && (flag || clip.IsAnimatablePath(serializedProperty.get_propertyPath())));
                }
            }
            return(result);
        }
        public static bool AddAnimatedParameterValueAt(this TimelineClip clip, string parameterName, float value, float time)
        {
            bool result;

            if (!clip.IsParameterAnimatable(parameterName))
            {
                result = false;
            }
            else
            {
                AnimatedParameterExtensions.CreateCurvesIfRequired(clip, null);
                EditorCurveBinding curveBinding       = clip.GetCurveBinding(parameterName);
                AnimationCurve     animationCurve     = AnimationUtility.GetEditorCurve(clip.curves, curveBinding) ?? new AnimationCurve();
                SerializedObject   serializedObject   = AnimatedParameterExtensions.GetSerializedObject(clip);
                SerializedProperty serializedProperty = serializedObject.FindProperty(parameterName);
                bool stepped = serializedProperty.get_propertyType() == 1 || serializedProperty.get_propertyType() == null || serializedProperty.get_propertyType() == 7;
                CurveEditUtility.AddKeyFrameToCurve(animationCurve, time, clip.curves.get_frameRate(), value, stepped);
                AnimationUtility.SetEditorCurve(clip.curves, curveBinding, animationCurve);
                result = true;
            }
            return(result);
        }
        public static bool HasAnyAnimatableParameters(this TimelineClip clip)
        {
            bool result;

            if (clip.asset == null || Attribute.IsDefined(clip.asset.GetType(), typeof(NotKeyableAttribute)))
            {
                result = false;
            }
            else if (!clip.HasScriptPlayable())
            {
                result = false;
            }
            else
            {
                SerializedObject serializedObject = AnimatedParameterExtensions.GetSerializedObject(clip);
                if (serializedObject == null)
                {
                    result = false;
                }
                else
                {
                    SerializedProperty iterator = serializedObject.GetIterator();
                    bool flag  = true;
                    bool flag2 = clip.asset is IPlayableBehaviour;
                    bool flag3 = false;
                    while (iterator.NextVisible(flag))
                    {
                        if (AnimatedParameterExtensions.IsAnimatable(iterator.get_propertyType()) && AnimatedParameterExtensions.IsKeyable(clip.asset.GetType(), iterator.get_propertyPath()))
                        {
                            flag3 |= (flag2 || clip.IsAnimatablePath(iterator.get_propertyPath()));
                        }
                    }
                    result = flag3;
                }
            }
            return(result);
        }