public override void Update(KeyPoint kp) { int i = m_Value.IndexOf(kp); if (i != -1) { Vector2KeyPoint vkp = kp as Vector2KeyPoint; m_DataSource.SetValue(i, kp.Time, vkp.m_Value); } }
public void Bind(NDistributionVector2Curve curve) { m_Value.Clear(); m_DataSource = curve; for (int j = 0; j < m_DataSource.KeyCount; ++j) { Vector2 v = m_DataSource.GetValue(j); Vector2KeyPoint kp = new Vector2KeyPoint(); kp.Time = m_DataSource.GetTime(j); kp.m_Value = v; m_Value.Add(kp); } }
public override void AddKeyPoint(float time) { Vector2 v = m_DataSource.GetValue(time); m_DataSource.AddKey(v, time); Vector2KeyPoint kp = new Vector2KeyPoint(); kp.m_Value = v; kp.Time = time; m_Value.Add(kp); KeyPointComparer kpc = new KeyPointComparer(); m_Value.Sort(kpc); }