소리 관련 블럭에서 대기할 때 일시정지한 동안의 시간도 포함하는 오류 해결 #2921
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
개요
block_sound.js에서,
"소리 재생하고 기다리기" 관련 블럭이 일시정지 했을 때에도 대기가 멈추지 않습니다.
따라서, 특정 소리를 재생하고 기다린다고 할 때, 중간에 일시정지를 했다가 해제하면,
소리의 재생이 끝나기도 전에 다음 블럭이 실행됩니다.
수정 내역
현재 소리를 재생하고 기다리는 블럭은
sound_something_wait_with_block
,sound_something_second_wait_with_block
,sound_from_to_and_wait
이 3가지인데,
해당 블럭은 전부
setInterval
을 이용해 대기를 하기 때문에 일시정지의 영향을 받지 않습니다.해당 로직을 soundInstance의
complete
리스너로 변경했습니다.추가적으로, ~초 재생하고 기다리기 코드는 음악 중단에
setInterval
을 사용하고 있었기 때문에Entry.Utils.playSound
의duration
옵션으로 변경하였습니다.