| | 1 | | using UnityEngine; |
| | 2 | |
|
| | 3 | | [CreateAssetMenu(fileName = "AudioEventWithPitchIncrement", menuName = "AudioEvents/AudioEvent - With pitch increment")] |
| | 4 | | public class AudioEvent_WithPitchIncrement : AudioEvent |
| | 5 | | { |
| | 6 | | [SerializeField] |
| | 7 | | float pitchIncrement; |
| | 8 | |
|
| | 9 | | public override void Initialize(AudioContainer audioContainer) |
| | 10 | | { |
| 51 | 11 | | base.Initialize(audioContainer); |
| 51 | 12 | | OnPlay += OnEventPlay; |
| 51 | 13 | | } |
| | 14 | |
|
| 0 | 15 | | public void ResetPitch() { SetPitch(initialPitch); } |
| | 16 | |
|
| 0 | 17 | | void OnEventPlay() { SetPitch(pitch + pitchIncrement); } |
| | 18 | | } |