private void updateSpinningSample(ValueChangedEvent <bool> tracking) { if (tracking.NewValue) { spinningSample?.Play(); spinningSample?.VolumeTo(1, 200); } else { spinningSample?.VolumeTo(0, 200).Finally(_ => spinningSample.Stop()); } }
private void updateSpinningSample(ValueChangedEvent <bool> tracking) { if (tracking.NewValue) { spinningSample?.Play(!spinningSample.IsPlaying); spinningSample?.VolumeTo(1, 300); } else { spinningSample?.VolumeTo(0, 300).OnComplete(_ => spinningSample.Stop()); } }
protected override void UpdateHitStateTransforms(ArmedState state) { base.UpdateHitStateTransforms(state); this.FadeOut(fade_out_duration).OnComplete(_ => { // looping sample should be stopped here as it is safer than running in the OnComplete // of the volume transition above. spinningSample.Stop(); }); Expire(); // skin change does a rewind of transforms, which will stop the spinning sound from playing if it's currently in playback. isSpinning?.TriggerChange(); }
public override void StopAllSamples() { base.StopAllSamples(); spinningSample?.Stop(); }
public override void StopAllSamples() { base.StopAllSamples(); holdSample?.Stop(); }