Beispiel #1
0
 public void OnPointerDown(PointerEventData eventData)
 {
     if (button.interactable && type == Type.SoundOnPointerDown)
     {
         SoundMaster.PlayOneShot(bundle);
     }
 }
Beispiel #2
0
        private void Awake()
        {
            button = GetComponent <Button>();

            if (type == Type.SoundOnClick)
            {
                button.onClick.AddListener(() => SoundMaster.PlayOneShot(bundle));
            }

            if (bundle == null)
            {
                bundle = SoundMaster.Instance.defaultButtonClick;
            }
        }
Beispiel #3
0
        private IEnumerator ClaimRewardsAsync(int currentProgress, int newProgress)
        {
            yield return(new WaitForSecondsRealtime(0.3f));

            var stage = Game.CurrentStage;

            for (var i = currentProgress; i < newProgress; i++)
            {
                yield return(new WaitForSecondsRealtime(0.3f));

                SoundMaster.PlayOneShot(woohSound);
                rewards[i].ClaimReward();
                _collectedRewards.Enqueue(stage.Rewards[i]);
                stage.Rewards[i].Collect(true, false);
            }

            Game.SaveCurrentStageProgress(Player.Accuracy, true);
            DataManager.SaveData();
            okayButton.Interactable = true;
        }
        private IEnumerator UpdateLineAsync()
        {
            cardsTransform.Clear();
            var cards        = new List <ProductCard>();
            var offerUpdated = offerMaster.TryToUpdateOffers();
            var offers       = offerMaster.GetOffers();

            foreach (var offer in offers)
            {
                var card = Instantiate(offer.GetCardPrefab(), cardsTransform);
                card.Initialize(offer);
                cards.Add(card);
            }

            UpdateOffersUpdateText(offerMaster.TimeLeftUntilUpdate);
            if (!offerUpdated)
            {
                yield break;
            }
            var audioClip = Assets.Instance.offerUpdated;

            SoundMaster.PlayOneShot(audioClip);
            yield return(new WaitForSecondsRealtime(0.1f));

            foreach (var card in cards)
            {
                yield return(new WaitForSecondsRealtime(0.05f));

                card.Woop();
            }

            yield return(new WaitForSecondsRealtime(0.1f));

            if (_offersUpdateTextAnimator)
            {
                _offersUpdateTextAnimator.SetTrigger(Triggers.Woop);
            }
        }
 public void PlayOneShot()
 {
     SoundMaster.PlayOneShot(bundle, _audioSource);
 }