Exemplo n.º 1
0
        public async UniTask <int> FadeIn()
        {
            swipe.ConstructNewSwipe();

            RectTransform rectTransform = GetComponent <RectTransform> ();

            rectTransform.anchoredPosition = new Vector2(0f, 130f);

            if (text.activeSelf)
            {
                text.GetComponent <CanvasGroup> ().alpha = 0;
                text.GetComponent <CanvasGroup> ().DOFade(1f, 0.5f).SetAutoKill(false);
            }

            rectTransform.DOKill();
            await rectTransform.DOAnchorPosY(0f, 0.5f).AsyncWaitForCompletion();

            rectTransform.DOKill();
            //while (GetComponent<Animator> ().GetCurrentAnimatorStateInfo (0).IsName ("Idle")) {
            //    await UniTask.Yield ();
            //}

            swipe.StartSwipe();
            return(1);
        }