private void AddPPtrKeyframe(PPtrCurve curve, AnimationClipBindingConstant bindings, float time, int index)
        {
            if (!m_pptrs.TryGetValue(curve, out List <PPtrKeyframe> pptrCurve))
            {
                pptrCurve = new List <PPtrKeyframe>();
                m_pptrs.Add(curve, pptrCurve);
                AddPPtrKeyframe(curve, bindings, 0.0f, index - 1);
            }

            PPtr <Object> value   = bindings.PptrCurveMapping[index];
            PPtrKeyframe  pptrKey = new PPtrKeyframe(time, value);

            pptrCurve.Add(pptrKey);
        }
        private void AddCustomCurve(AnimationClipBindingConstant bindings, GenericBinding binding, string path, float time, float value)
        {
            switch (binding.CustomType)
            {
            case BindingCustomType.AnimatorMuscle:
                AddAnimatorMuscleCurve(binding, path, time, value);
                break;

            default:
                string attribute = m_customCurveResolver.ToAttributeName(binding.CustomType, binding.Attribute, path);
                if (binding.IsPPtrCurve)
                {
                    PPtrCurve curve = new PPtrCurve(path, attribute, binding.ClassID, binding.Script.CastTo <MonoScript>());
                    AddPPtrKeyframe(curve, bindings, time, (int)value);
                }
                else
                {
                    FloatCurve curve = new FloatCurve(path, attribute, binding.ClassID, binding.Script.CastTo <MonoScript>());
                    AddFloatKeyframe(curve, time, value);
                }
                break;
            }
        }
Exemplo n.º 3
0
 public PPtrCurve(PPtrCurve copy, IReadOnlyList <PPtrKeyframe> keyframes) :
     this(copy.Path, copy.Attribute, copy.ClassID, copy.Script, keyframes)
 {
 }