void Update()
        {
            if (Target.text != oldText)
            {
                if (Target.text.Contains("\t"))
                {
                    Target.text = Target.text.Replace("\t", string.Empty);


                    return;
                }


                if (TypeSound)
                {
                    if (NextSound < Time.time)
                    {
                        Audio2DListener.PlayUI(TypeSound, 1);
                        NextSound = Time.time + SoundLag;
                    }
                }

                UpdateText(Target.text);
            }
        }
Exemple #2
0
        private void Call(bool value)
        {
            if (UseStaticValue)
            {
                if (value)
                {
                    if (ClickSound)
                    {
                        if (NextSound < Time.time)
                        {
                            Audio2DListener.PlayUI(ClickSound, 1);
                            NextSound = Time.time + SoundLag;
                        }
                    }

                    SetValue(StaticValueBinding.MemberName, StaticValue);
                }
            }
            else
            {
                if (ClickSound)
                {
                    if (NextSound < Time.time)
                    {
                        Audio2DListener.PlayUI(ClickSound, 1);
                        NextSound = Time.time + SoundLag;
                    }
                }

                SetValue(ValueBinding.MemberName, value);
            }
        }
        IEnumerator PlayAsync(float delay)
        {
            if (Source)
            {
                Source.Stop();
                Source    = null;
                IsPlaying = false;
            }

            IsPlaying = true;

            if (delay > 0)
            {
                yield return(new WaitForSeconds(delay));
            }

            Source        = Audio2DListener.GetNext();
            Source.loop   = Loop;
            Source.pitch  = Pitch;
            Source.volume = Volume * AudioManager.GetVolume(Layer);
            Source.clip   = Clip;

            while (Source != null && Source.isPlaying)
            {
                yield return(1);
            }

            Source    = null;
            IsPlaying = false;
        }
        private void HandleChange(float arg)
        {
            if (!Application.isPlaying)
            {
                return;
            }

            if (SwipeSound != null)
            {
                if (NextSwipe < Time.time)
                {
                    Audio2DListener.PlayUI(SwipeSound, 1);
                    NextSwipe = Time.time + SoundLag;
                }
            }

            SetValue(ValueBinding.MemberName, arg);
        }