Beispiel #1
0
    private IEnumerator DoTransformAnimation()
    {
        position = transform.position;
        list     = NewList();
        var lerpTime = 0f;
        var vel      = Vector3.zero;

        while (gameObject.activeSelf)
        {
            var deltaTime = Time.deltaTime;
            lerpTime = lerpTime + (LerpSpeed * deltaTime);

            yield return(null);

            if (lerpTime >= LERP_TIME_THRESHOLD)
            {
                lerpTime -= 1;
                list      = NewList();
            }
            else
            {
                list[0] = transform.position;
            }

            var lerpPos = Vector3Lerp.Lerp(list, lerpTime);
            transform.position = lerpPos;
        }
    }
 private void LateUpdate()
 {
     PositionConstraint.translationOffset = Vector3Lerp.Lerp(Target.position, Target.position + Offset, ScaleRef.Value);
 }