ETFXPitchRandomizer.cs 306 B

1234567891011121314151617
  1. using UnityEngine;
  2. using System.Collections;
  3. namespace EpicToonFX
  4. {
  5. public class ETFXPitchRandomizer : MonoBehaviour
  6. {
  7. public float randomPercent = 10;
  8. void Start ()
  9. {
  10. transform.GetComponent<AudioSource>().pitch *= 1 + Random.Range(-randomPercent / 100, randomPercent / 100);
  11. }
  12. }
  13. }