public static object GetCurrentValue(AnimationWindowState state, AnimationWindowCurve curve)
 {
     if (UnityEditor.AnimationMode.InAnimationMode() && (curve.rootGameObject != null))
     {
         return(AnimationWindowUtility.GetCurrentValue(curve.rootGameObject, curve.binding));
     }
     return(curve.Evaluate(state.currentTime - curve.timeOffset));
 }
예제 #2
0
 // Retrieve current value.  If bindings are available and value is animated, use bindings to get value.
 // Otherwise, evaluate AnimationWindowCurve at current time.
 public static object GetCurrentValue(AnimationWindowState state, AnimationWindowCurve curve)
 {
     if (state.previewing && curve.rootGameObject != null)
     {
         return(AnimationWindowUtility.GetCurrentValue(curve.rootGameObject, curve.binding));
     }
     else
     {
         return(curve.Evaluate(state.currentTime));
     }
 }
예제 #3
0
        public static object GetCurrentValue(AnimationWindowState state, AnimationWindowCurve curve)
        {
            object result;

            if (AnimationMode.InAnimationMode() && curve.rootGameObject != null)
            {
                result = AnimationWindowUtility.GetCurrentValue(curve.rootGameObject, curve.binding);
            }
            else
            {
                result = curve.Evaluate(state.currentTime - curve.timeOffset);
            }
            return(result);
        }