mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-26 05:50:18 +00:00
when stopping radio sound, save radio station's time only if audio source is playing
This commit is contained in:
parent
8e8e495633
commit
1b19e38bc6
1 changed files with 2 additions and 1 deletions
|
@ -131,7 +131,8 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
||||||
m_isPlayingRadio = false;
|
m_isPlayingRadio = false;
|
||||||
m_isWaitingForNewRadioSound = false;
|
m_isWaitingForNewRadioSound = false;
|
||||||
|
|
||||||
if (m_currentRadioStationIndex >= 0)
|
// save current station's time
|
||||||
|
if (m_currentRadioStationIndex >= 0 && m_radioAudioSource.isPlaying)
|
||||||
RadioStation.stations[m_currentRadioStationIndex].currentTime = m_radioAudioSource.time;
|
RadioStation.stations[m_currentRadioStationIndex].currentTime = m_radioAudioSource.time;
|
||||||
|
|
||||||
m_radioAudioSource.Stop();
|
m_radioAudioSource.Stop();
|
||||||
|
|
Loading…
Reference in a new issue