public void RegisterKeyEvent(float timePercent, CurveKeyEvent kEvent) { CurveKeyInfo info = new CurveKeyInfo(); info.m_TimePointPercent = timePercent; info.m_KeyEvent = kEvent; info.m_IsExecuted = false; m_CurveKeyList.Add(info); }
private void TriggerEvent(float percent) { for (int index = 0; index < m_CurveKeyList.Count; index++) { CurveKeyInfo info = m_CurveKeyList[index]; if (info != null && !info.m_IsExecuted && info.m_KeyEvent != null && percent >= info.m_TimePointPercent) { info.m_IsExecuted = true; info.m_KeyEvent(m_Velocity, m_MoveElapsed); } } }
public void Reset() { m_Target = null; m_IsMoving = false; m_MoveElapsed = 0; m_Percent = 0; for (int index = 0; index < m_CurveKeyList.Count; index++) { CurveKeyInfo info = m_CurveKeyList[index]; if (info != null) { info.m_IsExecuted = false; } } }