Skip to content

Commit 48ec92c

Browse files
committed
#5 UISettings for Music and Sound bug fixed
1 parent ecd3634 commit 48ec92c

File tree

3 files changed

+704
-9
lines changed

3 files changed

+704
-9
lines changed

Assets/Scripts/Managers/AudioController.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ private void Awake()
2828
audioController = this;
2929
}
3030
}
31+
32+
private void Start()
33+
{
34+
AudioController.audioController.SetMusiceAudioSourcesVlolume();
35+
AudioController.audioController.SetSFXAudioSourcesVlolume();
36+
}
3137
public void PlayClickAudio()
3238
{
3339
sfxForBtns.PlayOneShot(clickAudio);
@@ -37,10 +43,20 @@ public void PlayClickAudio()
3743
public void SetMusiceAudioSourcesVlolume()
3844
{
3945
musicSource.volume = PlayerPrefs.GetFloat(UISettingContontoller.music);
46+
backrgroundAudio.volume = PlayerPrefs.GetFloat(UISettingContontoller.music);
4047
}
4148
public void SetSFXAudioSourcesVlolume()
4249
{
4350
sfxForBtns.volume = PlayerPrefs.GetFloat(UISettingContontoller.sfx);
51+
placeBuildingAudio.volume = PlayerPrefs.GetFloat(UISettingContontoller.sfx);
52+
cancelAudio.volume = PlayerPrefs.GetFloat(UISettingContontoller.sfx);
53+
fixBuildingAudio.volume = PlayerPrefs.GetFloat(UISettingContontoller.sfx);
54+
nextTurnAudio.volume = PlayerPrefs.GetFloat(UISettingContontoller.sfx);
55+
cantPlaceBuildingAudio.volume = PlayerPrefs.GetFloat(UISettingContontoller.sfx);
56+
nextLevelAudio.volume = PlayerPrefs.GetFloat(UISettingContontoller.sfx);
57+
levelFailedAudio.volume = PlayerPrefs.GetFloat(UISettingContontoller.sfx);
58+
59+
4460
}
4561

4662
public void PlaceBuildingPlay()

Assets/Scripts/Managers/UISettingContontoller.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public void OnChangeMusicVolume(float lvl)
6363
{
6464
PlayerPrefs.SetFloat(music, lvl);
6565
AudioController.audioController.SetMusiceAudioSourcesVlolume();
66+
6667
}
6768
public void OnChangeBrightness(float lvl)
6869
{

0 commit comments

Comments
 (0)