From f8ae07a319c09a2e6f48733a3e985afb7a0b2269 Mon Sep 17 00:00:00 2001 From: MartyTheGout Date: Sat, 9 Nov 2024 15:59:12 +0900 Subject: [PATCH] =?UTF-8?q?Bug:=20=EC=99=BC=EC=AA=BD=EC=86=90=20=EC=86=90?= =?UTF-8?q?=EB=AA=A9=20=ED=9A=8C=EC=A0=84=EC=8B=9C=20=EC=86=8C=EB=A6=AC?= =?UTF-8?q?=EA=B0=80=20=EB=82=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20=ED=98=84?= =?UTF-8?q?=EC=83=81=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Stretchings/Hand/HandRollingStretchingView.swift | 4 ++-- ...andRollingStretchingViewModel+UpdateTransform.swift | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingView.swift b/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingView.swift index b9e7a84..23c4d17 100644 --- a/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingView.swift +++ b/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingView.swift @@ -104,14 +104,14 @@ struct HandRollingStretchingView: View { let colorValueChangedTo = min (newValue * 2, 6) viewModel.getDifferentRingColor(viewModel.rightGuideRing, intChangeTo: Int32(colorValueChangedTo)) Task { - await viewModel.playRotationChangeRingSound(newValue) + await viewModel.playRotationChangeRingSound(newValue, chirality: .right) } } .onChange(of: viewModel.leftRotationCount, initial: false ) { _, newValue in let colorValueChangedTo = min (newValue * 2 + 1, 7) viewModel.getDifferentRingColor(viewModel.leftGuideRing, intChangeTo: Int32(colorValueChangedTo)) Task { - await viewModel.playRotationChangeRingSound(newValue) + await viewModel.playRotationChangeRingSound(newValue, chirality: .left) } } .onChange(of: viewModel.rightHitCount, initial: false ) { oldNumber, newNumber in diff --git a/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingViewModel+UpdateTransform.swift b/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingViewModel+UpdateTransform.swift index 9961189..cb3512d 100644 --- a/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingViewModel+UpdateTransform.swift +++ b/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingViewModel+UpdateTransform.swift @@ -123,13 +123,15 @@ extension HandRollingStretchingViewModel { return previous + (current - previous) * factor } - func playRotationChangeRingSound(_ newValue: Int) async { + func playRotationChangeRingSound(_ newValue: Int, chirality : Chirality) async { + + let guideRing = chirality == .left ? leftGuideRing : rightGuideRing if newValue >= 3 { - try? await playSpatialAudio(rightGuideRing, audioInfo: AudioFindHelper.handRotationThreeTimes) + try? await playSpatialAudio(guideRing, audioInfo: AudioFindHelper.handRotationThreeTimes) } else if newValue == 2 { - try? await playSpatialAudio(rightGuideRing, audioInfo: AudioFindHelper.handRotationTwice) + try? await playSpatialAudio(guideRing, audioInfo: AudioFindHelper.handRotationTwice) } else if newValue == 1 { - try? await playSpatialAudio(rightGuideRing, audioInfo: AudioFindHelper.handRotationOnce) + try? await playSpatialAudio(guideRing, audioInfo: AudioFindHelper.handRotationOnce) } } }