コード例 #1
0
 IEnumerator Tween()
 {
     timer = 0;
     while (timer < duration)
     {
         timer            += Time.deltaTime;
         target.localScale = Vector3.Lerp(startingScale, targetScale, timer / duration);
         yield return(null);
     }
     OnTweenEnd.Invoke();
 }
コード例 #2
0
 IEnumerator Tween()
 {
     timer = 0;
     while (timer < duration)
     {
         timer       += Time.deltaTime;
         target.color = Color.Lerp(startingColor, targetColor, timer / duration);
         yield return(null);
     }
     OnTweenEnd.Invoke();
 }
コード例 #3
0
 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();
 }
コード例 #4
0
        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();
        }