Esempio n. 1
0
    IEnumerator showView(RectTransform holder, states state)
    {
        loadingPopup.anchoredPosition = Vector3.down * screenOffset;
        messagePopup.anchoredPosition = Vector3.down * screenOffset;
        choosePopup.anchoredPosition  = Vector3.down * screenOffset;
        Canvas.ForceUpdateCanvases();

        yield return(this.DoUnscaledTween01(t =>
        {
            //loadingPopup.localScale = Vector3.one * PennerAnimation.QuadEaseInOut(t, 0, 1, 1);
            holder.localPosition = new Vector3(
                0,
                PennerAnimation.BackEaseOut(t, -screenOffset, screenOffset, 1),
                0
                );
        }, 0.75f));

        background.interactable   = true;
        background.blocksRaycasts = true;

        while (fsm.currentState == state)
        {
            yield return(0);
        }

        this.DoUnscaledTween01(t =>
        {
            //loadingPopup.localScale = Vector3.one * PennerAnimation.QuadEaseInOut(t, 1, -1, 1);
            holder.localPosition = new Vector3(
                0,
                PennerAnimation.BackEaseIn(t, 0, screenOffset, 1),
                0
                );
        }, 0.5f);
    }
Esempio n. 2
0
    public static IEnumerator EaseBackInScaleFromTo(Transform t, float f, float to, float animationTime)
    {
        float elapsedTime = 0;

        while (elapsedTime < animationTime)
        {
            t.localScale = Vector3.one * PennerAnimation.BackEaseIn(elapsedTime,
                                                                    f,
                                                                    to - f,
                                                                    animationTime);
            elapsedTime += Time.deltaTime;
            yield return(0);
        }
        t.localScale = Vector3.one * to;
    }