IEnumerator Tween() { timer = 0; while (timer < duration) { timer += Time.deltaTime; target.localScale = Vector3.Lerp(startingScale, targetScale, timer / duration); yield return(null); } OnTweenEnd.Invoke(); }
IEnumerator Tween() { timer = 0; while (timer < duration) { timer += Time.deltaTime; target.color = Color.Lerp(startingColor, targetColor, timer / duration); yield return(null); } OnTweenEnd.Invoke(); }
IEnumerator Tween() { timer = 0; while (timer < duration) { timer += Time.deltaTime; Vector3 t = addToOriginalPosition ? targetPosition + startingPosition : targetPosition; target.localPosition = Vector3.Lerp(startingPosition, t, timer / duration); yield return(null); } OnTweenEnd.Invoke(); }
IEnumerator Tween() { timer = 0; Quaternion tRot = Quaternion.Euler(targetRotationEuler); while (timer < duration) { timer += Time.deltaTime; target.localRotation = Quaternion.Slerp(startingRotation, tRot, timer / duration); yield return(null); } OnTweenEnd.Invoke(); }