예제 #1
0
        /// <summary>
        /// Close this widget.
        /// </summary>
        public virtual void Close()
        {
            TweenCanvasGroupAlpha(canvasGroup.alpha, 0f);
            TweenTransformScale(rectTransform.localScale, Vector3.zero);

            UIUtility.PlaySound(closeSound, 1.0f);
            canvasGroup.interactable   = false;
            canvasGroup.blocksRaycasts = false;
            if (onClose != null && canvasGroup.alpha > 0f)
            {
                onClose.Invoke();
            }
        }
예제 #2
0
        /// <summary>
        /// Show this widget.
        /// </summary>
        public virtual void Show()
        {
            if (focus)
            {
                Focus();
            }
            TweenCanvasGroupAlpha(canvasGroup.alpha, 1f);
            TweenTransformScale(rectTransform.localScale, Vector3.one);

            UIUtility.PlaySound(showSound, 1.0f);
            if (interactable)
            {
                canvasGroup.interactable   = true;
                canvasGroup.blocksRaycasts = true;
            }
            if (onShow != null && canvasGroup.alpha < 1f)
            {
                onShow.Invoke();
            }
        }
예제 #3
0
        /// <summary>
        /// Show this widget.
        /// </summary>
        public virtual void Show()
        {
            deactivate = false;
            gameObject.SetActive(true);
            if (focus)
            {
                Focus();
            }
            TweenCanvasGroupAlpha(canvasGroup.alpha, 1f);

            TweenTransformScale(Vector3.ClampMagnitude(rectTransform.localScale, 1.9f), Vector3.one);

            UIUtility.PlaySound(showSound, 1.0f);
            canvasGroup.interactable   = true;
            canvasGroup.blocksRaycasts = true;
            if (onShow != null && canvasGroup.alpha < 1f)
            {
                onShow.Invoke();
            }
        }