Esempio n. 1
0
        private IEnumerator Showcoroutine(UserTaskTip data)
        {
            _data = data;

            if (data == null)
            {
                Destroy(gameObject);
                yield break;
            }

            var title       = data.title;
            var description = data.condition_description;

            Title.text       = title;
            Description.text = description;

            if (_tweener != null)
            {
                _tweener.Kill();
                _tweener = null;
            }

            Canvas.ForceUpdateCanvases();

            yield return(null);

            var height = DialogContent.sizeDelta.y;

            DialogContent.anchoredPosition = new Vector2(0, height);
            _tweener = DOTween.Sequence();
            _tweener.Append(DialogContent.DOAnchorPos(Vector2.zero, ShowTime))
            .AppendInterval(StayTime)
            .Append(DialogContent.DOAnchorPos(new Vector2(0, height), HideTime))
            .OnComplete(() => Destroy(gameObject));

            _tweener.Play();
        }
Esempio n. 2
0
 public void ApplyData(UserTaskTip data)
 {
     _data = data;
 }