easeOutCirc() public static method

public static easeOutCirc ( float start, float end, float val ) : float
start float
end float
val float
return float
Example #1
0
    void Update()
    {
        if (lastTile != null && destinationTile != null)
        {
            // Tween move
            float progress = (Time.time - walkStart) / (1f / walkRate);
            transform.position = Vector3.Lerp(lastTile.GetCoordinate(), destinationTile.GetCoordinate(), LeanTween.easeInOutCubic(0f, 1f, progress));

            // Tween rotate
            transform.rotation = Quaternion.Lerp(lastRotation, targetRotation, LeanTween.easeOutCirc(0f, 1f, progress));
        }

        if (Time.time > walkStart + 1f / walkRate)
        {
            if (!map)
            {
                GameObject go = GameObject.FindGameObjectWithTag("Map");
                if (go != null)
                {
                    map = GameObject.FindGameObjectWithTag("Map").GetComponent <Map>();
                }
            }


            if (steps >= maxSteps * 2 || (steps > 0 && memory.Count == 0))
            {
                Destroy(gameObject);
            }

            TryWalk();
        }
    }
Example #2
0
    private IEnumerator DoubleRewardsRoutine()
    {
        yield return(new WaitForSeconds(0.25f));

        doubleRewardsActiveContainer.SetActive(value: true);
        Vector3 origPos = doubleRewardsTextContainer.position;

        doubleRewardsTextContainer.position = Vector3.zero;
        float   time2 = 0.6f;
        Vector2 scale = Vector2.one * 2f;

        AudioMap.PlayClipAt("vipDoubleSplash", Vector3.zero, AudioMap.instance.uiMixerGroup);
        for (float t2 = 0f; t2 < time2; t2 += Time.deltaTime)
        {
            doubleRewardsTextContainer.localScale = Vector2.Lerp(Vector2.one, scale, LeanTween.easeOutCirc(0f, 1f, t2 / time2));
            yield return(null);
        }
        yield return(new WaitForSeconds(0.25f));

        Vector2 centerPos = doubleRewardsTextContainer.position;

        time2 = 0.4f;
        for (float t2 = 0f; t2 < time2; t2 += Time.deltaTime)
        {
            doubleRewardsTextContainer.position   = Vector2.Lerp(centerPos, origPos, LeanTween.easeOutCirc(0f, 1f, t2 / time2));
            doubleRewardsTextContainer.localScale = Vector2.Lerp(scale, Vector2.one, LeanTween.easeOutCubic(0f, 1f, t2 / time2));
            yield return(null);
        }
        doubleRewardsTextContainer.anchoredPosition = Vector2.zero;
        yield return(new WaitForSeconds(0.25f));

        AudioMap.PlayClipAt("vipDoubleRoll", Vector3.zero, AudioMap.instance.uiMixerGroup);
        int num;

        for (int i = 0; i != elements.Count; i = num)
        {
            elements[i].SetDoubleValues(shopItems[i]);
            yield return(null);

            num = i + 1;
        }
        StartCoroutine(DoubleRewardsEOFRoutine());
    }
        public void ScaleIcon(float scale, bool shrink)
        {
            var   iconTransform = icon.transform;
            float scaleMultiplier;

            if (shrink)
            {
                if (Mathf.Round(scale * 100) / 100 < 1)
                {
                    scaleMultiplier = LeanTween.easeOutCirc(1, 0, scale);
                }
                else
                {
                    scaleMultiplier = 1;
                }
            }
            else
            {
                scaleMultiplier = LeanTween.easeInCirc(0, 1, scale);
            }
            iconTransform.localScale = new Vector3(scaleMultiplier * IconScale, scaleMultiplier * IconScale, 1);
        }
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();
            }
        }