Assets.Scripts.Scenes.Game.ComboHits.ComboHitZoneController.PlayHitSound C# (CSharp) Méthode

PlayHitSound() public méthode

public PlayHitSound ( float sequenceProgress ) : void
sequenceProgress float
Résultat void
        public void PlayHitSound(float sequenceProgress)
        {
            AudioSource audioSource = GetComponent<AudioSource>();
            audioSource.pitch = HIT_SOUND_BASE_PITCH + sequenceProgress * HIT_SOUND_PITCH_INCREMENT_MULTIPLIER;
            audioSource.Play();
        }

Usage Example

 private void ProcessHitZoneClicked(ComboHitZoneController hitZoneController)
 {
     ShowHitFeedbackText();
     hitZoneController.PlayHitSound((float)hitSequence.NextHitZoneIndex / hitSequence.HitZones.Count);
     hitSequence.MoveNext();
 }