public void TogglePlay(bool isOn)
    {
        if (tween == null)
        {
            targetBool = isOn;
            playEvent  = TogglePlay;
            return;
        }

        if (isOn)
        {
            panel.gameObject.SetActive(true);
            tween.PlayForward();
        }
        else
        {
            if (quickClose)
            {
                panel.gameObject.SetActive(false);
            }
            else
            {
                tween.PlayReverse();
            }
        }
    }
Exemplo n.º 2
0
 public virtual void PlayAnim(bool isEnter, UnityAction onComplete)
 {
     tween = CreateTweener(isEnter);
     if (onComplete != null)
     {
         tween.AddOnFinished(onComplete);
     }
     tween.ResetToBeginning();
     tween.PlayForward();
 }
Exemplo n.º 3
0
 public void EnterAnim(UIAnimType animType, UnityAction onComplete)
 {
     ResetAnim(animType);
     if (onComplete != null)
     {
         tween.AddOnFinished(onComplete);
     }
     tween.ResetToBeginning();
     tween.PlayForward();
 }
Exemplo n.º 4
0
    void Start()
    {
        _tweenEvent.AddListener(() =>
        {
            StartCoroutine(TextAnimation());
        });

        _text.enabled = true;
        _tween.SetOnFinished(_tweenEvent);
        _tween.PlayForward();
    }
Exemplo n.º 5
0
    public void TogglePlay(bool isOn)
    {
        if (tween == null)
        {
            targetBool = isOn;
            playEvent  = TogglePlay;
            return;
        }

        if (isOn)
        {
            tween.PlayForward();
        }
        else
        {
            tween.PlayReverse();
        }
    }