public _AnimCurve(AnimationCurve[] curves, KFType tp, EditorCurveBinding[] bindings, AnimationClip clip) { Dbg.Assert(curves.Length > 0, "_AnimCurve.ctor: curves[] has zero element"); m_Curves = curves; m_Clip = clip; m_KfType = tp; m_KeyCnt = m_Curves[0].length; //Dbg.Log("{0}:{1} keyCnt:{2}", binding.path, binding.propertyName, m_KeyCnt); m_Bindings = bindings; // check key count for (int i = 0; i < m_Curves.Length; ++i) { if (m_Curves[i].length != m_KeyCnt) { Dbg.LogWarn("_AnimCurve.ctor: the key count not match other curves: {0} != {1}, {2}:{3}", m_Curves[i], m_KeyCnt, m_Bindings[0].path, m_Bindings[0].propertyName); } } // assign keys m_Kf4Curves = new Keyframe[m_Curves.Length][]; for (int i = 0; i < m_Curves.Length; ++i) { m_Kf4Curves[i] = m_Curves[i].keys; } Dbg.Assert(m_KeyCnt >= 2, "_AnimCurve.ctor: curve has less than 2 keys: {0}", m_Curves[0]); // init _KeyFrame array _InitKeyframes(); }
internal Keyframe(long time, Recording parent, KFType type) { //Container = container; Parent = parent; t = time; Type = type; }
public static Keyframe Build(string line, Recording p) { int a = 0, b = line.IndexOf("|"); string rtype = line.Substring(a, b - a); a = b + 1; b = line.IndexOf(";"); string rtime = line.Substring(a, b - a); long time = long.Parse(rtime); KFType type = (KFType)Enum.Parse(typeof(KFType), rtype); switch (type) { case KFType.MOUSE: return(new KeyframeM(line, time, p)); default: return(new KeyframeK(line, time, p)); } }