Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: app image 추가 #51

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import SwiftUI
import AVFoundation

struct ContentView: View {

@EnvironmentObject
var globalStore: GlobalStore

Expand Down Expand Up @@ -44,3 +43,12 @@ struct ContentView: View {
}
}

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
let globalStore = GlobalStore()
ContentView().environmentObject(globalStore)
.previewDevice(PreviewDevice(rawValue: "iPhone 14"))
.previewDisplayName("iPhone 14")

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct ButtonSelectCharcterView: View {
Button {
completion()
} label: {
CustomText(value: "\(index + 1). \(charcter.personalColor)", color: charcter == .coffee ? .red : CustomColor.scriptColor)
CustomText(value: "\(index + 1). \(charcter.personalColor)", color: CustomColor.scriptColor)
.frame(minWidth: 0, maxWidth: .infinity, maxHeight: .infinity)
}
.frame(minWidth: 0, maxWidth: .infinity ,maxHeight: .infinity)
Expand Down
8 changes: 7 additions & 1 deletion View/SceneView/SequenceView/SequenceEndingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct SequenceEndingView: View {
@State private var treasure = false
@State private var MC2 = false


let backgroundMusicFiles = ["BGM_PopPop"]
let soundEffectFiles = ["SFX_SeqEnd_coin_cluster8", "SFX_SeqEnd_sounds_fanfare1"] // add the names of your sound effect files here
let musicFileExtension = "wav" // add the extension of your music files here
//let soundEffectCountIntervals = [2, 4] // play sound effects when the count is equal to these values
Expand Down Expand Up @@ -137,6 +137,12 @@ struct SequenceEndingView: View {
.onReceive(globalStore.$scriptCount, perform: { currentCount in
handleSequenceView(scriptCount: currentCount)
switch currentCount {
case 0 :
let musicFileName = backgroundMusicFiles[0] // count starts at 1, but array index starts at 0
let musicFileUrl = Bundle.main.url(forResource: musicFileName, withExtension: musicFileExtension)!
backgroundMusicPlayer = AVPlayer(url: musicFileUrl)
backgroundMusicPlayer?.volume = volume
backgroundMusicPlayer?.play()
case 4:
let musicFileName = soundEffectFiles[0] // count starts at 1, but array index starts at 0
let musicFileUrl = Bundle.main.url(forResource: musicFileName, withExtension: musicFileExtension)!
Expand Down
12 changes: 9 additions & 3 deletions View/SceneView/SequenceView/SequenceOneView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ struct SequenceOneView: View {



let backgroundMusicFiles = ["BGM_Adventure_Rest", "Walk"]
let soundEffectFiles = ["SFX_SeqOne_sound_neutral6", "SFX_SeqOne_lowhealth_alarmloop7", "SFX_SeqOne_sound_neutral11", "SFX_SeqOne_alarm_loop6", "SFX_SeqOne_coin_double7"] // add the names of your sound effect files here
let backgroundMusicFiles = ["BGM_Adventure_Rest"]
let soundEffectFiles = ["SFX_SeqOne_sound_neutral6", "SFX_SeqOne_lowhealth_alarmloop7", "SFX_SeqOne_sound_neutral11", "SFX_SeqOne_alarm_loop6", "SFX_SeqOne_coin_double7", "Walk"] // add the names of your sound effect files here
let musicFileExtension = "wav" // add the extension of your music files here
let musicFileExtension1 = "m4a"
//let soundEffectCountIntervals = [2, 4] // play sound effects when the count is equal to these values
Expand Down Expand Up @@ -110,11 +110,17 @@ struct SequenceOneView: View {
handleSequenceView(scriptCount: currentCount)
switch currentCount {
case 0:
let musicFileName = backgroundMusicFiles[1] // count starts at 1, but array index starts at 0
let musicFileName = backgroundMusicFiles[0] // count starts at 1, but array index starts at 0
let musicFileUrl = Bundle.main.url(forResource: musicFileName, withExtension: musicFileExtension)!
backgroundMusicPlayer = AVPlayer(url: musicFileUrl)
backgroundMusicPlayer?.volume = volume
backgroundMusicPlayer?.play()

// let effectFileName = soundEffectFiles[0] // count starts at 1, but array index starts at 0
// let effectFileUrl = Bundle.main.url(forResource: effectFileName, withExtension: musicFileExtension1)!
// soundEffectPlayer = AVPlayer(url: effectFileUrl)
// soundEffectPlayer?.volume = volume1
// soundEffectPlayer?.play()
case 1:
let musicFileName = soundEffectFiles[0] // count starts at 1, but array index starts at 0
let musicFileUrl = Bundle.main.url(forResource: musicFileName, withExtension: musicFileExtension)!
Expand Down
12 changes: 6 additions & 6 deletions View/SceneView/SequenceView/SequenceOpeningView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ struct SequenceOpeningView: View {
soundEffectPlayer = AVPlayer(url: effectFileUrl)
soundEffectPlayer?.volume = volume1
soundEffectPlayer?.play()
case 4 :
let effectFileName = soundEffectFiles[1] // count starts at 1, but array index starts at 0
let effectFileUrl = Bundle.main.url(forResource: effectFileName, withExtension: musicFileExtension1)!
soundEffectPlayer = AVPlayer(url: effectFileUrl)
soundEffectPlayer?.volume = volume1
soundEffectPlayer?.play()
// case 4 :
// let effectFileName = soundEffectFiles[1] // count starts at 1, but array index starts at 0
// let effectFileUrl = Bundle.main.url(forResource: effectFileName, withExtension: musicFileExtension1)!
// soundEffectPlayer = AVPlayer(url: effectFileUrl)
// soundEffectPlayer?.volume = volume1
// soundEffectPlayer?.play()
case 6 :
let effectFileName = soundEffectFiles[2] // count starts at 1, but array index starts at 0
let effectFileUrl = Bundle.main.url(forResource: effectFileName, withExtension: musicFileExtension1)!
Expand Down
4 changes: 2 additions & 2 deletions View/SceneView/SequenceView/SequenceTwoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ struct SequenceTwoView: View {



let backgroundMusicFiles = ["Walk"]
let soundEffectFiles = ["SFX_SeqTwo_sound_nagger2", "SFX_SeqTwo_sounds_button6", "SFX_SeqTwo_interaction20", "SFX_SeqTwo_menu_move4", "SFX_SeqOne_sound_neutral11"] // add the names of your sound effect files here
let backgroundMusicFiles = ["BGM_Adventure_Rest"]
let soundEffectFiles = ["Walk", "SFX_SeqTwo_sound_nagger2", "SFX_SeqTwo_sounds_button6", "SFX_SeqTwo_interaction20", "SFX_SeqTwo_menu_move4", "SFX_SeqOne_sound_neutral11"] // add the names of your sound effect files here
let musicFileExtension = "wav" // add the extension of your music files here
let musicFileExtension1 = "wav"
//let soundEffectCountIntervals = [2, 4] // play sound effects when the count is equal to these values
Expand Down