public void AnimationOnUpdate(float value) { if (enabled == false) { return; } curAnimationValue = value; Vector3 toPos = Vector3.zero; movePathBase.GetPointAtTime(value, out toPos); gameObject.transform.localPosition = toPos; UpdateRotation(); if (onAnimationUpdate != null) { onAnimationUpdate(value); } }
public void Update() { if (!isPlay) { return; } if (Time.time < fStartTime + delay) { return; } float curTime = Time.time - (fStartTime + delay); movePath.GetPointAtTime(curTime / time, out tempPos); transform.position = tempPos; if (curTime > time) { if (onMoveFinish != null) { onMoveFinish(gameObject); } } }