예제 #1
0
        /// <summary>
        /// Gets called When Widget Pushed.
        /// </summary>
        /// <param name="IsPlayTween"> Play OnHide Tween of Current Widget </param>
        public void Show(bool IsPlayTween = true)
        {
            if (OnShow != null)
            {
                OnShow.Invoke();
            }
            gameObject.SetActive(true);
            if (IsPlayTween)
            {
                if (Tweens != null)
                {
                    Tweens.PerformOnShowTweens(gameObject);
                }
            }

            IsActive = true;
            CanvasGroup.interactable = true;
        }
예제 #2
0
        /// <summary>
        /// Gets called when Widget poped
        /// </summary>
        /// <param name="IsPlayTween"> Play OnShow Tween of previous widget </param>
        public void Hide(bool IsPlayTween = true)
        {
            if (OnHide != null)
            {
                OnHide.Invoke();
            }
            if (IsPlayTween)
            {
                if (Tweens != null)
                {
                    Tweens.PerformOnHideTweens(gameObject, () => { gameObject.SetActive(false); });
                }
            }
            else
            {
                gameObject.SetActive(false);
            }

            IsActive = false;
        }
예제 #3
0
파일: Widget.cs 프로젝트: swaphack/effect
 /// <summary>
 /// 派发事件
 /// </summary>
 protected void DipatchEvent()
 {
     TriggerHandler?.Invoke(this);
 }