From 97dd7735dd5b72ce2d07696791b1446a432859db Mon Sep 17 00:00:00 2001 From: Kazinski Date: Sun, 1 May 2022 16:56:29 -0500 Subject: [PATCH] added ambient/jingles for weather. Fixed kingbumper --- Assets/Prefabs/Environment/Archer/Arrow.prefab | 2 +- Assets/Scenes/Game-Mountain.unity | 16 ++++++++++++---- Assets/Scripts/UI/WeatherWheel.cs | 15 ++++++++++++--- UserSettings/EditorUserSettings.asset | 2 +- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/Assets/Prefabs/Environment/Archer/Arrow.prefab b/Assets/Prefabs/Environment/Archer/Arrow.prefab index 217a2a4..f7b0335 100644 --- a/Assets/Prefabs/Environment/Archer/Arrow.prefab +++ b/Assets/Prefabs/Environment/Archer/Arrow.prefab @@ -100,7 +100,7 @@ MonoBehaviour: target: {x: 0, y: 0, z: 0} isLive: 0 dir: {x: 0, y: 0, z: 0} - speed: 135 + speed: 150 bumpPower: 25 --- !u!114 &2287528990630677962 MonoBehaviour: diff --git a/Assets/Scenes/Game-Mountain.unity b/Assets/Scenes/Game-Mountain.unity index 2e2a184..108f74a 100644 --- a/Assets/Scenes/Game-Mountain.unity +++ b/Assets/Scenes/Game-Mountain.unity @@ -67376,6 +67376,14 @@ PrefabInstance: propertyPath: m_Name value: WeatherWheel objectReference: {fileID: 0} + - target: {fileID: 6861462054085696516, guid: cb8332a22eb05c44686906967b43b48a, type: 3} + propertyPath: RainAmbi + value: + objectReference: {fileID: 980634330} + - target: {fileID: 6861462054085696516, guid: cb8332a22eb05c44686906967b43b48a, type: 3} + propertyPath: windAmbi + value: + objectReference: {fileID: 994807984} - target: {fileID: 6861462054085696516, guid: cb8332a22eb05c44686906967b43b48a, type: 3} propertyPath: fogJingle value: @@ -147993,7 +148001,7 @@ AudioSource: OutputAudioMixerGroup: {fileID: 0} m_audioClip: {fileID: 8300000, guid: 1bc9d8dad6d9ced4a8fe887d5521196f, type: 3} m_PlayOnAwake: 0 - m_Volume: 1 + m_Volume: 0.65 m_Pitch: 1 Loop: 0 Mute: 0 @@ -154968,7 +154976,7 @@ AudioSource: OutputAudioMixerGroup: {fileID: 0} m_audioClip: {fileID: 8300000, guid: a6abd788f7a7ded498e53e1778ee151f, type: 3} m_PlayOnAwake: 0 - m_Volume: 1 + m_Volume: 0.65 m_Pitch: 1 Loop: 0 Mute: 0 @@ -203437,7 +203445,7 @@ AudioSource: OutputAudioMixerGroup: {fileID: 0} m_audioClip: {fileID: 8300000, guid: 7f227bc6a7115b2468188c5f89a58ffa, type: 3} m_PlayOnAwake: 0 - m_Volume: 1 + m_Volume: 0.8 m_Pitch: 1 Loop: 0 Mute: 0 @@ -311365,7 +311373,7 @@ AudioSource: OutputAudioMixerGroup: {fileID: 0} m_audioClip: {fileID: 8300000, guid: 40e71d8bd1a193f4ca1fd7928c1b6e5d, type: 3} m_PlayOnAwake: 0 - m_Volume: 1 + m_Volume: 0.8 m_Pitch: 1 Loop: 0 Mute: 0 diff --git a/Assets/Scripts/UI/WeatherWheel.cs b/Assets/Scripts/UI/WeatherWheel.cs index 552c264..237a3d9 100644 --- a/Assets/Scripts/UI/WeatherWheel.cs +++ b/Assets/Scripts/UI/WeatherWheel.cs @@ -17,6 +17,12 @@ public class WeatherWheel : NetworkBehaviour { private float weatherDuration = 20f; private float postWeatherCooldown = 10f; + public AudioSource snowJingle; + public AudioSource fogJingle; + public AudioSource RainAmbi; + public AudioSource windAmbi; + + void Start() { gameObject.GetComponent().enabled = false; pointer.SetActive(false); @@ -84,7 +90,7 @@ public class WeatherWheel : NetworkBehaviour { { // Snow SpawnWeatherServerRPC(PlayerStats.Weather.Snow); - + snowJingle.Play(); // Set angle back to centered transform.localRotation = Quaternion.Euler(0, 0, 90); } @@ -100,7 +106,7 @@ public class WeatherWheel : NetworkBehaviour { { // Fog SpawnWeatherServerRPC(PlayerStats.Weather.Fog); - + fogJingle.Play(); // Set angle back to centered transform.localRotation = Quaternion.Euler(0, 0, 270); } @@ -118,7 +124,8 @@ public class WeatherWheel : NetworkBehaviour { // Stop weather after duration StopWeatherServerRPC(); - + RainAmbi.Stop(); + windAmbi.Stop(); // Post weather cool down for (int i = 0; i < postWeatherCooldown; i++) { yield return new WaitForSecondsRealtime(1f); @@ -156,6 +163,7 @@ public class WeatherWheel : NetworkBehaviour { foreach(GameObject go in Rains) { go.GetComponent().Play(); } + RainAmbi.Play(); break; case PlayerStats.Weather.Snow: GameObject[] Snows = GameObject.FindGameObjectsWithTag("SnowSystem"); @@ -171,6 +179,7 @@ public class WeatherWheel : NetworkBehaviour { // Also store the wind direction go.GetComponent().windDireciton = windDir; } + windAmbi.Play(); break; case PlayerStats.Weather.Fog: GameObject[] Fogs = GameObject.FindGameObjectsWithTag("FogSystem"); diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index c77901b..453555f 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -27,7 +27,7 @@ EditorUserSettings: value: 22424703114646680e0b0227036c6f1f05033f2b212d68252320092a flags: 0 RecentlyUsedScenePath-7: - value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb + value: 22424703114646680e0b0227036c6f1f05033f2b212d68252320092a flags: 0 RecentlyUsedScenePath-8: value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb