From 42b7238a7fc7afb582e93ffa3c78e9a94a6ffe2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Sat, 9 Apr 2016 13:41:32 -0400 Subject: [PATCH] Earth crush shounds --- Assets/Background.cs | 2 +- Assets/Prefabs/WedgePrefab.prefab | 75 ++++++++++++++ Assets/Prefabs/WedgePrefab00.prefab | 150 ++++++++++++++++++++++++++++ Assets/Scripts/Asteroid.cs | 2 +- Assets/Scripts/PlanetManager.cs | 8 +- Assets/_Scenes/Main.unity | 2 +- 6 files changed, 235 insertions(+), 4 deletions(-) diff --git a/Assets/Background.cs b/Assets/Background.cs index 615af01..ad715b7 100644 --- a/Assets/Background.cs +++ b/Assets/Background.cs @@ -12,7 +12,7 @@ public class Background : MonoBehaviour { if (RandomRotationSpeed) - rotationSpeed = 10 * UnityEngine.Random.Range(0.25f, 1f); + rotationSpeed = 10 * UnityEngine.Random.Range(1.25f, 3f); rotationDirection = (Mathf.Floor(UnityEngine.Random.Range(0.0f, 1.99f)) * 2 - 1); } diff --git a/Assets/Prefabs/WedgePrefab.prefab b/Assets/Prefabs/WedgePrefab.prefab index 58d7579..9b743be 100644 --- a/Assets/Prefabs/WedgePrefab.prefab +++ b/Assets/Prefabs/WedgePrefab.prefab @@ -9,6 +9,7 @@ GameObject: m_Component: - 4: {fileID: 475784} - 212: {fileID: 21292000} + - 82: {fileID: 8265624} m_Layer: 0 m_Name: WedgePrefab m_TagString: Untagged @@ -28,6 +29,80 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 +--- !u!82 &8265624 +AudioSource: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 186656} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: 3d4d970a0bbdd934e95ffcf72fc5225c, type: 3} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 1 + BypassListenerEffects: 1 + BypassReverbZones: 1 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 --- !u!212 &21292000 SpriteRenderer: m_ObjectHideFlags: 1 diff --git a/Assets/Prefabs/WedgePrefab00.prefab b/Assets/Prefabs/WedgePrefab00.prefab index 5b93e66..736549f 100644 --- a/Assets/Prefabs/WedgePrefab00.prefab +++ b/Assets/Prefabs/WedgePrefab00.prefab @@ -11,6 +11,7 @@ GameObject: - 212: {fileID: 21228928} - 135: {fileID: 13583406} - 54: {fileID: 5455998} + - 82: {fileID: 8206496} m_Layer: 0 m_Name: WedgePrefab m_TagString: Wedge @@ -26,6 +27,7 @@ GameObject: serializedVersion: 4 m_Component: - 4: {fileID: 411762} + - 82: {fileID: 8202378} m_Layer: 0 m_Name: WedgePrefab00 m_TagString: Untagged @@ -73,6 +75,154 @@ Rigidbody: m_Interpolate: 0 m_Constraints: 0 m_CollisionDetection: 0 +--- !u!82 &8202378 +AudioSource: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 170328} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: 3d4d970a0bbdd934e95ffcf72fc5225c, type: 3} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 1 + BypassListenerEffects: 1 + BypassReverbZones: 1 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 +--- !u!82 &8206496 +AudioSource: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 152938} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: 3d4d970a0bbdd934e95ffcf72fc5225c, type: 3} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 1 + BypassListenerEffects: 1 + BypassReverbZones: 1 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 --- !u!135 &13583406 SphereCollider: m_ObjectHideFlags: 1 diff --git a/Assets/Scripts/Asteroid.cs b/Assets/Scripts/Asteroid.cs index 1b2a97c..38f4251 100644 --- a/Assets/Scripts/Asteroid.cs +++ b/Assets/Scripts/Asteroid.cs @@ -82,7 +82,7 @@ public class Asteroid : MonoBehaviour AudioSource.PlayClipAtPoint(audio.clip, transform.position, audio.volume); var wait = new WaitForSeconds(emitter.GetComponent().duration); - //Destroy(emitter); + Destroy(emitter); } diff --git a/Assets/Scripts/PlanetManager.cs b/Assets/Scripts/PlanetManager.cs index 7dfc99f..dc40528 100644 --- a/Assets/Scripts/PlanetManager.cs +++ b/Assets/Scripts/PlanetManager.cs @@ -133,7 +133,13 @@ public class PlanetManager : MonoBehaviour w.timeSincePushedToMinimum = Time.time; w.offset = CartierMinRatio; } - + + if (w.offset < wOffsetBefore) + { + var audio = w.gameObject.GetComponent(); + audio.bypassListenerEffects = true; + AudioSource.PlayClipAtPoint(audio.clip, transform.position, audio.volume); + } w.sprite.transform.localScale = new Vector3(w.offset, w.offset, 1); diff --git a/Assets/_Scenes/Main.unity b/Assets/_Scenes/Main.unity index 43eeab2..eaba91d 100644 --- a/Assets/_Scenes/Main.unity +++ b/Assets/_Scenes/Main.unity @@ -399,7 +399,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 11401034, guid: 198e988adacced646a19f757f6237ae1, type: 2} propertyPath: CriticalMin - value: 0.2 + value: 0.15 objectReference: {fileID: 0} - target: {fileID: 11401034, guid: 198e988adacced646a19f757f6237ae1, type: 2} propertyPath: CriticalMax