コード例 #1
0
        public static bool SetAnimatedParameter(this TimelineClip clip, string parameterName, AnimationCurve curve)
        {
            bool result;

            if (!clip.IsParameterAnimated(parameterName) && !clip.AddAnimatedParameter(parameterName))
            {
                result = false;
            }
            else
            {
                EditorCurveBinding curveBinding = clip.GetCurveBinding(parameterName);
                AnimationUtility.SetEditorCurve(clip.curves, curveBinding, curve);
                result = true;
            }
            return(result);
        }