Esempio n. 1
0
        public virtual void OnClick(/*bool isClickCanceled,*/ Tween.TweenCallback callback = null)
        {
            if (tween != null && !tween.isCompleted)
            {
                tween.Complete();
            }

            if (interactable)
            {
#if MODULE_AUDIO_NATIVE
                NativeAudioHandler.PlayButtonPressSound();
#endif

                if (animationType == AnimationType.Tween)
                {
                    tween = graphic.transform.DOScale(1f, 0.04f, true).SetEasing(Ease.Type.QuadIn).OnComplete(!isClickCanceled ? callback : null);
                }
                else
                {
                    animator.SetTrigger(pointerUpTriggerParameter);
                    Tween.DelayedCall(0.075f, !isClickCanceled ? callback : null);
                }
            }
            else
            {
                //if (disabledSound != null)
                //    AudioController.PlaySound(disabledSound, AudioController.AudioType.Sound);
                //NativeAudioHandler.PlayButtonPressSound();

                //tween = graphic.transform.DOScale(1f, 0.075f, true).SetEasing(Ease.Type.QuadIn);
            }
        }
Esempio n. 2
0
        public void OnPointerUp(PointerEventData eventData)
        {
            SetState(!state);

#if MODULE_AUDIO_NATIVE
            NativeAudioHandler.PlayButtonPressSound();
#endif
        }