Example #1
0
 public PPtrCurve(string path, string attribute, ClassIDType classID, PPtr <MonoScript> script, IReadOnlyList <PPtrKeyframe> keyframes) :
     this(path, attribute, classID, script)
 {
     m_curve = new PPtrKeyframe[keyframes.Count];
     for (int i = 0; i < keyframes.Count; i++)
     {
         m_curve[i] = keyframes[i];
     }
 }
        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);
        }