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); }
override public IEnumerator Select() { float elapsedTime = 0; float animationTime = 0.5f; while (currentState == state.Select && elapsedTime < animationTime) { float scale = PennerAnimation.BackEaseOut(elapsedTime / animationTime, 0, 1, 1); transform.localScale = pivotScale + Vector3.one * 0.25f * scale; elapsedTime += Time.unscaledDeltaTime; yield return(0); } transform.localScale = pivotScale + Vector3.one * 0.25f; while (currentState == state.Select) { yield return(0); } yield return(gameObject.DoUnscaledTween01(t => { float scale = PennerAnimation.QuadEaseIn(t, 1, -1, 1); transform.localScale = pivotScale + Vector3.one * 0.25f * scale; }, 0.1f)); }
public static IEnumerator EaseBackOutScaleFromTo(RectTransform t, float f, float to, float animationTime) { float elapsedTime = 0; while (elapsedTime < animationTime) { t.localScale = Vector3.one * PennerAnimation.BackEaseOut(elapsedTime, f, to - f, animationTime); elapsedTime += Time.deltaTime; yield return(0); } t.localScale = Vector3.one * to; }