コード例 #1
0
 public void OnPointerDown(PointerEventData eventData)
 {
     if (button.interactable && type == Type.SoundOnPointerDown)
     {
         SoundMaster.PlayOneShot(bundle);
     }
 }
コード例 #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;
            }
        }
コード例 #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;
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
 public void PlayOneShot()
 {
     SoundMaster.PlayOneShot(bundle, _audioSource);
 }