added settings sfx sound; increased range for orcs and mutants
Marco Andronaco andronacomarco@gmail.com
Fri, 17 Apr 2020 12:43:48 +0200
5 files changed,
204 insertions(+),
4 deletions(-)
M
Assets/Prefabs/Overworld/EnemyMutant.prefab
→
Assets/Prefabs/Overworld/EnemyMutant.prefab
@@ -545,7 +545,7 @@ m_GameObject: {fileID: 4656789200949370965}
m_Material: {fileID: 0} m_IsTrigger: 1 m_Enabled: 1 - m_Radius: 10 + m_Radius: 20 m_Height: 1 m_Direction: 1 m_Center: {x: 0, y: 0, z: 0}
M
Assets/Prefabs/Overworld/EnemyOrc.prefab
→
Assets/Prefabs/Overworld/EnemyOrc.prefab
@@ -1361,7 +1361,7 @@ m_GameObject: {fileID: 5314719787374066515}
m_Material: {fileID: 0} m_IsTrigger: 1 m_Enabled: 1 - m_Radius: 10 + m_Radius: 20 m_Height: 1 m_Direction: 1 m_Center: {x: 0, y: 0, z: 0}
M
Assets/Prefabs/UI/settings_panel.prefab
→
Assets/Prefabs/UI/settings_panel.prefab
@@ -2204,6 +2204,7 @@ serializedVersion: 6
m_Component: - component: {fileID: 5261656949874394308} - component: {fileID: 5261656949874394363} + - component: {fileID: 9156233768656770445} m_Layer: 5 m_Name: slider_sound m_TagString: Untagged@@ -2296,6 +2297,103 @@ m_BoolArgument: 0
m_CallState: 2 m_TypeName: UnityEngine.UI.Slider+SliderEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null +--- !u!82 &9156233768656770445 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5261656949874394309} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 8739253723341074782, guid: 74b130e74b71401439101ad1b2c8ef5e, + type: 2} + m_audioClip: {fileID: 8300000, guid: 2e5f3da0944d6e84bb0e50415ec16158, type: 3} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 --- !u!1 &5261656949897897458 GameObject: m_ObjectHideFlags: 0@@ -2410,6 +2508,7 @@ - component: {fileID: 5261656949916970792}
- component: {fileID: 5261656949916970793} - component: {fileID: 5261656949916970794} - component: {fileID: 5261656949916970799} + - component: {fileID: 3519578912458088655} m_Layer: 5 m_Name: settings_panel m_TagString: Untagged@@ -2502,6 +2601,104 @@ sfxSlider: {fileID: 5261656949874394363}
textSlider: {fileID: 5261656949722716282} battleSlider: {fileID: 5261656950599322912} mixer: {fileID: 24100000, guid: 74b130e74b71401439101ad1b2c8ef5e, type: 2} + sfxTest: {fileID: 8300000, guid: 07cd98210ec91174cadc6e697cc03102, type: 3} +--- !u!82 &3519578912458088655 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5261656949916970795} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 8739253723341074782, guid: 74b130e74b71401439101ad1b2c8ef5e, + type: 2} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 --- !u!1 &5261656949926496455 GameObject: m_ObjectHideFlags: 0
M
Assets/Scripts/Overworld/OverworldUIManager.cs
→
Assets/Scripts/Overworld/OverworldUIManager.cs
@@ -328,7 +328,6 @@ target_panel.SetActive(false);
updateSTPanel(panel[(int)Panel.Abilities].transform.GetChild(0), party, true); break; default: - Debug.Log("You shouldn't be here."); break; }
M
Assets/Scripts/Utility/SettingsManager.cs
→
Assets/Scripts/Utility/SettingsManager.cs
@@ -15,6 +15,8 @@ public OverworldUIManager ui;
public Slider musicSlider, sfxSlider; public Slider textSlider, battleSlider; public AudioMixer mixer; + private new AudioSource audio; + [SerializeField] AudioClip sfxTest = null; public void SetMusicVolume(float sliderValue) {@@ -24,6 +26,8 @@ }
public void SetSfxVolume(float sliderValue) { + if(sfxTest && !audio.isPlaying) + audio.PlayOneShot(sfxTest); mixer.SetFloat("SfxVolume", Mathf.Log10(sliderValue) * 20); PlayerPrefs.SetFloat("SfxVolume", sliderValue); }@@ -43,7 +47,7 @@
public void Start() { gm = GameMaster.Instance; - + audio = GetComponent<AudioSource>(); //restore playerprefs musicSlider.value = PlayerPrefs.GetFloat("MusicVolume", 0.75f); sfxSlider.value = PlayerPrefs.GetFloat("SfxVolume", 0.75f);