easeOutExpo() public static method

public static easeOutExpo ( float start, float end, float val ) : float
start float
end float
val float
return float
Example #1
0
    public void Absorb(Vector2 position, float damage)
    {
        health -= damage;
        float a = LeanTween.easeOutExpo(0f, 1f, health / fullHealth);

        GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, a);
        for (int i = 0; i < particles.Length; i++)
        {
            particles[i].transform.position = position;
            particles[i].Emit(Random.Range(10, 20));
        }
    }
 private void Update()
 {
     //check if target value
     if (m_slider.value != m_targetSliderValue)
     {
         //update time
         m_currentLerpTime += Time.deltaTime;
         if (m_currentLerpTime > m_lerpTime)
         {
             m_currentLerpTime = m_lerpTime;
         }
         //lerp & update slider value
         float perc = m_currentLerpTime / m_lerpTime;
         m_slider.value = LeanTween.easeOutExpo(m_slider.value, m_targetSliderValue, perc);
     }
 }
    private IEnumerator AnimateUnlock()
    {
        AudioMap.PlayClipAt(AudioMap.instance["levelUnlock"], Vector3.zero, AudioMap.instance.uiMixerGroup);
        CanvasGroup buttonCanvasGroup = unlockButton.GetComponent <CanvasGroup>();
        float       time = 0.4f;

        for (float t2 = 0f; t2 <= time; t2 += Time.deltaTime)
        {
            buttonCanvasGroup.alpha = LeanTween.easeOutExpo(1f, 0f, t2 / time);
            yield return(null);
        }
        unlockButton.gameObject.SetActive(value: false);
        CanvasGroup scoreCanvasGroup = scoreText.GetComponent <CanvasGroup>();

        CanvasGroup[] componentsInChildren = scoreText.GetComponentsInChildren <CanvasGroup>();
        CanvasGroup   scoreBgCanvasGroup   = scoreCanvasGroup;

        CanvasGroup[] array = componentsInChildren;
        foreach (CanvasGroup canvasGroup in array)
        {
            if (canvasGroup != scoreCanvasGroup)
            {
                scoreBgCanvasGroup = canvasGroup;
            }
        }
        scoreCanvasGroup.alpha   = 0f;
        scoreBgCanvasGroup.alpha = 0f;
        scoreText.gameObject.SetActive(value: true);
        for (float t2 = 0f; t2 <= time; t2 += Time.deltaTime)
        {
            float val = t2 / time;
            scoreCanvasGroup.alpha   = LeanTween.easeInExpo(0f, 1f, val);
            scoreBgCanvasGroup.alpha = LeanTween.easeInExpo(0f, 1f, val);
            yield return(null);
        }
        scoreCanvasGroup.alpha   = 1f;
        scoreBgCanvasGroup.alpha = 1f;
    }
Example #4
0
        public float GetValue(float start, float end, float t)
        {
            switch (Easing)
            {
            case LeanTweenType.notUsed:
                return(0f);

            case LeanTweenType.animationCurve:
                return(Mathf.Lerp(start, end, AnimationCurve.Evaluate(t)));

            case LeanTweenType.linear:
                return(LeanTween.linear(start, end, t));

            case LeanTweenType.easeOutQuad:
                return(LeanTween.easeOutQuad(start, end, t));

            case LeanTweenType.easeInQuad:
                return(LeanTween.easeInQuad(start, end, t));

            case LeanTweenType.easeInOutQuad:
                return(LeanTween.easeInOutQuad(start, end, t));

            case LeanTweenType.easeInCubic:
                return(LeanTween.easeInCubic(start, end, t));

            case LeanTweenType.easeOutCubic:
                return(LeanTween.easeOutCubic(start, end, t));

            case LeanTweenType.easeInOutCubic:
                return(LeanTween.easeInOutCubic(start, end, t));

            case LeanTweenType.easeInQuart:
                return(LeanTween.easeInQuart(start, end, t));

            case LeanTweenType.easeOutQuart:
                return(LeanTween.easeOutQuart(start, end, t));

            case LeanTweenType.easeInOutQuart:
                return(LeanTween.easeInOutQuart(start, end, t));

            case LeanTweenType.easeInQuint:
                return(LeanTween.easeInQuint(start, end, t));

            case LeanTweenType.easeOutQuint:
                return(LeanTween.easeOutQuint(start, end, t));

            case LeanTweenType.easeInOutQuint:
                return(LeanTween.easeInOutQuint(start, end, t));

            case LeanTweenType.easeInSine:
                return(LeanTween.easeInSine(start, end, t));

            case LeanTweenType.easeOutSine:
                return(LeanTween.easeOutSine(start, end, t));

            case LeanTweenType.easeInOutSine:
                return(LeanTween.easeInOutSine(start, end, t));

            case LeanTweenType.easeInExpo:
                return(LeanTween.easeInExpo(start, end, t));

            case LeanTweenType.easeOutExpo:
                return(LeanTween.easeOutExpo(start, end, t));

            case LeanTweenType.easeInOutExpo:
                return(LeanTween.easeInOutExpo(start, end, t));

            case LeanTweenType.easeInCirc:
                return(LeanTween.easeInCirc(start, end, t));

            case LeanTweenType.easeOutCirc:
                return(LeanTween.easeOutCirc(start, end, t));

            case LeanTweenType.easeInOutCirc:
                return(LeanTween.easeInOutCirc(start, end, t));

            case LeanTweenType.easeInBounce:
                return(LeanTween.easeInBounce(start, end, t));

            case LeanTweenType.easeOutBounce:
                return(LeanTween.easeOutBounce(start, end, t));

            case LeanTweenType.easeInOutBounce:
                return(LeanTween.easeInOutBounce(start, end, t));

            case LeanTweenType.easeInBack:
                return(LeanTween.easeInBack(start, end, t));

            case LeanTweenType.easeOutBack:
                return(LeanTween.easeOutBack(start, end, t));

            case LeanTweenType.easeInOutBack:
                return(LeanTween.easeInOutBack(start, end, t));

            case LeanTweenType.easeInElastic:
                return(LeanTween.easeInElastic(start, end, t));

            case LeanTweenType.easeOutElastic:
                return(LeanTween.easeOutElastic(start, end, t));

            case LeanTweenType.easeInOutElastic:
                return(LeanTween.easeInOutElastic(start, end, t));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }