public void UpdateBehaviour() { if (m_PositionLerpData.IsStarted) { m_PositionLerpData.Increment(); transform.position = Vector3.Slerp(m_PositionLerpData.From, m_PositionLerpData.To, m_PositionLerpData.Progress); //Вращение в направлении к цели m_RotationLerpData.To = Quaternion.LookRotation(m_Target.transform.position - transform.position); transform.rotation = Quaternion.Lerp(m_RotationLerpData.From, m_RotationLerpData.To, m_PositionLerpData.Progress); if (m_PositionLerpData.Overtime()) { m_PositionLerpData.Stop(); transform.position = m_PositionLerpData.To; transform.rotation = m_RotationLerpData.To; if (OnFinished != null) { OnFinished(); OnFinished = null; } } } }
void Update() { if (m_LerpData.IsStarted) { m_LerpData.Increment(); Image_FG.fillAmount = Mathf.Lerp(m_LerpData.From, m_LerpData.To, m_LerpData.Progress); if (m_LerpData.Overtime()) { m_LerpData.Stop(); Image_FG.fillAmount = m_LerpData.To; } } }
public void Update() { if (m_LerpData.IsStarted) { m_LerpData.Increment(); Animate(); if (m_LerpData.Overtime()) { m_LerpData.Stop(); if (OnAnimationFinished != null) { OnAnimationFinished(this); } } } }
void Update() { if (m_DodgeTimeLerpData.IsStarted) { m_DodgeTimeLerpData.Increment(); m_CharacterController.SimpleMove(m_DodgeDir * DodgeSpeed); if (m_DodgeTimeLerpData.Overtime()) { m_DodgeTimeLerpData.Stop(); if (OnDodgeFinished != null) { OnDodgeFinished(); } } } }
void Update() { if (m_LerpData.IsStarted) { m_LerpData.Increment(); m_FadeImage.color = Color.Lerp(m_LerpData.From, m_LerpData.To, m_LerpData.Progress); if (m_LerpData.Overtime()) { m_LerpData.Stop(); m_FadeImage.color = m_LerpData.To; if (OnFadeAnimationComplete != null) { OnFadeAnimationComplete(); OnFadeAnimationComplete = null; } } } }
public void UpdateBehaviour() { if (m_LerpData.IsStarted) { m_LerpData.Increment(); transform.position = Vector3.Lerp(m_LerpData.From, m_LerpData.To, m_LerpData.Progress); if (m_LerpData.Overtime()) { m_LerpData.Stop(); if (OnFinished != null) { OnFinished(); OnFinished = null; } } } }