Exemplo n.º 1
0
        public override void ProcessCandidates()
        {
            BeginKeyModification();

            EditorCurveBinding[] bindings            = AnimationUtility.GetCurveBindings(m_CandidateClip);
            EditorCurveBinding[] objectCurveBindings = AnimationUtility.GetObjectReferenceCurveBindings(m_CandidateClip);

            List <AnimationWindowCurve> curves = new List <AnimationWindowCurve>();

            for (int i = 0; i < state.allCurves.Count; ++i)
            {
                AnimationWindowCurve curve           = state.allCurves[i];
                EditorCurveBinding   remappedBinding = RotationCurveInterpolation.RemapAnimationBindingForRotationCurves(curve.binding, m_CandidateClip);
                if (Array.Exists(bindings, binding => remappedBinding.Equals(binding)) || Array.Exists(objectCurveBindings, binding => remappedBinding.Equals(binding)))
                {
                    curves.Add(curve);
                }
            }

            AnimationWindowUtility.AddKeyframes(state, curves, time);

            EndKeyModification();

            ClearCandidates();
        }
Exemplo n.º 2
0
 public AnimationCurve GetCurveForBinding(EditorCurveBinding binding)
 {
     for (int i = 0; i < curves.Length; i++)
     {
         if (binding.Equals(bindings[i]))
         {
             return(curves[i]);
         }
     }
     return(null);
 }
Exemplo n.º 3
0
        public AnimationCurve GetCurveForBinding(EditorCurveBinding binding)
        {
            AnimationCurve result;

            for (int i = 0; i < this.curves.Length; i++)
            {
                if (binding.Equals(this.bindings[i]))
                {
                    result = this.curves[i];
                    return(result);
                }
            }
            result = null;
            return(result);
        }
Exemplo n.º 4
0
        public ObjectReferenceKeyframe[] GetObjectCurveForBinding(EditorCurveBinding binding)
        {
            if (objectCurves == null)
            {
                return(null);
            }

            for (int i = 0; i < objectCurves.Count; i++)
            {
                if (binding.Equals(objectBindings[i]))
                {
                    return(objectCurves[i]);
                }
            }
            return(null);
        }
Exemplo n.º 5
0
 public ObjectReferenceKeyframe[] GetObjectCurveForBinding(EditorCurveBinding binding)
 {
     ObjectReferenceKeyframe[] result;
     if (this.objectCurves == null)
     {
         result = null;
     }
     else
     {
         for (int i = 0; i < this.objectCurves.Count; i++)
         {
             if (binding.Equals(this.objectBindings[i]))
             {
                 result = this.objectCurves[i];
                 return(result);
             }
         }
         result = null;
     }
     return(result);
 }
 public override void ProcessCandidates()
 {
     if (!(this.m_CandidateClip == null))
     {
         this.BeginKeyModification();
         EditorCurveBinding[]        curveBindings = AnimationUtility.GetCurveBindings(this.m_CandidateClip);
         EditorCurveBinding[]        objectReferenceCurveBindings = AnimationUtility.GetObjectReferenceCurveBindings(this.m_CandidateClip);
         List <AnimationWindowCurve> list = new List <AnimationWindowCurve>();
         for (int i = 0; i < this.state.allCurves.Count; i++)
         {
             AnimationWindowCurve animationWindowCurve = this.state.allCurves[i];
             EditorCurveBinding   remappedBinding      = RotationCurveInterpolation.RemapAnimationBindingForRotationCurves(animationWindowCurve.binding, this.m_CandidateClip);
             if (Array.Exists <EditorCurveBinding>(curveBindings, (EditorCurveBinding binding) => remappedBinding.Equals(binding)) || Array.Exists <EditorCurveBinding>(objectReferenceCurveBindings, (EditorCurveBinding binding) => remappedBinding.Equals(binding)))
             {
                 list.Add(animationWindowCurve);
             }
         }
         AnimationWindowUtility.AddKeyframes(this.state, list.ToArray(), this.time);
         this.EndKeyModification();
         this.ClearCandidates();
     }
 }