public void StartAnimation()
        {
            Vector2 ourSize = GetComponent <RectTransform>().rect.size;
            Vector3 moveTo  = new Vector3(ourSize.x * Direction.x, ourSize.y * Direction.y, 0);

            transform.DOMove(moveTo, 2).OnComplete(() => AniamtionDone?.Invoke());
        }
        private void GoNext()
        {
            if (_currentIndex >= AnimationTextAndTime.Length)
            {
                AniamtionDone?.Invoke();
                return;
            }
            BeepSound.Stop();
            BeepSound.Play();
            CountAnimationData currentData = AnimationTextAndTime[_currentIndex++];

            _uiText.text = currentData.Text;
            Vector3 tragetScale = transform.localScale;

            transform.localScale = Vector3.zero;
            _uiTransform.DOScale(tragetScale, currentData.Time).OnComplete(GoNext);
        }
Beispiel #3
0
        public void StartAnimation()
        {
            _realPostionsOfChilds = new Dictionary <int, Vector3>();
            for (int i = 0; i < transform.childCount; i++)
            {
                Transform childTransform = transform.GetChild(i);
                _realPostionsOfChilds.Add(childTransform.GetHashCode(), childTransform.position);
            }
            Direction += new Vector2(0.5f, 0.5f);
            Vector2 ourSize = GetComponent <RectTransform>().rect.size;
            Vector3 moveTo  = new Vector3(ourSize.x * Direction.x, ourSize.y * Direction.y, 0);

            transform.DOMove(moveTo, Time).OnComplete(() => { OurCanvas.SetActive(false); AniamtionDone?.Invoke(); }).OnUpdate(() =>
            {
                for (int i = 0; i < transform.childCount; i++)
                {
                    Transform childTransform = transform.GetChild(i);
                    childTransform.position  = _realPostionsOfChilds[childTransform.GetHashCode()];
                }
            });
        }
 private void GoNextAnim()
 {
    _ourTweener =  DOVirtual.Float(1f, 0f,StartTime,ImageToVAriable);
     _ourTweener.OnComplete(()=> {AniamtionDone?.Invoke(); });
 }
Beispiel #5
0
 public void StartAnimation()
 {
     DOVirtual.Float(1.0f, 0.0f, FadeOutTime, FadeUpdate).OnComplete(() => { CounterCanvas.SetActive(false); AniamtionDone?.Invoke(); });
 }