diff --git a/Modules/GameEngineKit/Sources/_NewSystem/Views/DnD/OneToOne/DnDOneToOneView.swift b/Modules/GameEngineKit/Sources/_NewSystem/Views/DnD/OneToOne/DnDOneToOneView.swift index 2cd45cdcd..268e067cb 100644 --- a/Modules/GameEngineKit/Sources/_NewSystem/Views/DnD/OneToOne/DnDOneToOneView.swift +++ b/Modules/GameEngineKit/Sources/_NewSystem/Views/DnD/OneToOne/DnDOneToOneView.swift @@ -17,12 +17,44 @@ public struct DnDOneToOneView: View { // MARK: Public public var body: some View { - GeometryReader { proxy in - SpriteView(scene: self.makeScene(size: proxy.size), options: [.allowsTransparency]) - .frame(width: proxy.size.width, height: proxy.size.height) - .onAppear { - self.scene = DnDOneToOneBaseScene(viewModel: self.viewModel) + HStack(spacing: 0) { + if let action = self.viewModel.action { + Button { + // nothing to do } + label: { + ActionButtonView(action: action) + .padding(20) + } + .simultaneousGesture( + TapGesture() + .onEnded { _ in + withAnimation { + self.viewModel.isActionTriggered = true + } + } + ) + + Divider() + .opacity(0.4) + .frame(maxHeight: 500) + .padding(.vertical, 20) + } + + Spacer() + + GeometryReader { proxy in + SpriteView(scene: self.makeScene(size: proxy.size), options: [.allowsTransparency]) + .frame(width: proxy.size.width, height: proxy.size.height) + .onAppear { + self.scene = DnDOneToOneBaseScene(viewModel: self.viewModel) + } + } + .colorMultiply(self.viewModel.isActionTriggered ? .white : .gray.opacity(0.4)) + .animation(.easeOut(duration: 0.3), value: self.viewModel.isActionTriggered) + .allowsHitTesting(self.viewModel.isActionTriggered) + + Spacer() } }