diff --git a/Assets/Scripts/Astronaut.cs b/Assets/Scripts/Astronaut.cs index cd8f117..178e027 100644 --- a/Assets/Scripts/Astronaut.cs +++ b/Assets/Scripts/Astronaut.cs @@ -46,7 +46,8 @@ public class Astronaut : MonoBehaviour { if (oldState == AstronautState.Dashing) { - _astronautAnimator.Idle(); + _astronautAnimator.Land(); + //_astronautAnimator.Idle(); } else if (State == AstronautState.Walking) { @@ -148,6 +149,7 @@ public class Astronaut : MonoBehaviour { if (State == AstronautState.Dashing) { planet.PushWedge(this.theta); + State = AstronautState.Idle; } @@ -279,20 +281,4 @@ public class Astronaut : MonoBehaviour { } } - public void OnGUI() - { - if (GUI.Button(new Rect(10, 10, 150, 50), State.ToString())) - { - Stun(); - Debug.Log("Clicked the button with an image"); - //_astronautAnimator.Walk(); - //Eject(); - } - /* if (GUI.Button(new Rect(60, 10, 150, 50), "Stop")) - { - Debug.Log("Clicked the button with an image"); - _astronautAnimator.StopWalk(); - //Eject(); - }*/ - } } diff --git a/Assets/Scripts/Earthquake.cs b/Assets/Scripts/Earthquake.cs index b07acc3..00c1e8b 100644 --- a/Assets/Scripts/Earthquake.cs +++ b/Assets/Scripts/Earthquake.cs @@ -1,7 +1,7 @@ -using System; -using UnityEngine; -using System.Collections; - +using System; +using UnityEngine; +using System.Collections; + public class Earthquake : MonoBehaviour { public float CriticalMin; @@ -14,18 +14,18 @@ public class Earthquake : MonoBehaviour { private SpriteRenderer core; PlanetManager pmgr; - bool isExploding; - - - // Use this for initialization + bool isExploding; + + + // Use this for initialization public void Start() { isExploding = false; pmgr = FindObjectOfType(); - core = this.GetComponent(); - } - - // Update is called once per frame + core = this.GetComponent(); + } + + // Update is called once per frame public void Update () { if(isExploding) return; @@ -41,15 +41,6 @@ public class Earthquake : MonoBehaviour { if (val2 >= CriticalMax + 0.05f) { EarthquakeBoom(); - } - } - - void OnGUI() - { - if (GUI.Button(new Rect(100, 100, 50, 50), "BOOM")) - { - Debug.Log("Clicked the button with an image"); - EarthquakeBoom(); } } @@ -57,13 +48,19 @@ public class Earthquake : MonoBehaviour { { isExploding = true; StartCoroutine(Explode()); - Instantiate(ExplosionParticle); - var camera = GameObject.Find("Main Camera"); - if (camera) - { - var shaker = camera.GetComponent(); - if (shaker) shaker.shakeTimeAmount = 2.0f; - } + Instantiate(ExplosionParticle); + + var audioBoom = gameObject.GetComponent(); + audioBoom.bypassListenerEffects = true; + AudioSource.PlayClipAtPoint(audioBoom.clip, transform.position, audioBoom.volume); + + + var camera = GameObject.Find("Main Camera"); + if (camera) + { + var shaker = camera.GetComponent(); + if (shaker) shaker.shakeTimeAmount = 2.0f; + } } IEnumerator Explode() @@ -76,5 +73,5 @@ public class Earthquake : MonoBehaviour { pmgr.EjectPlayers(realPosition); yield return null; } - } -} + } +} diff --git a/Assets/Sounds/A_SFX_Planet_Explosion_01.wav b/Assets/Sounds/A_SFX_Planet_Explosion_01.wav new file mode 100644 index 0000000..2f33a16 Binary files /dev/null and b/Assets/Sounds/A_SFX_Planet_Explosion_01.wav differ diff --git a/Assets/Sounds/A_SFX_Planet_Explosion_01.wav.meta b/Assets/Sounds/A_SFX_Planet_Explosion_01.wav.meta new file mode 100644 index 0000000..ff7388c --- /dev/null +++ b/Assets/Sounds/A_SFX_Planet_Explosion_01.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: d1c2b1851e3fc7147bf24267eabf01fd +timeCreated: 1460236386 +licenseType: Pro +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Scenes/Main.unity b/Assets/_Scenes/Main.unity index 9472641..77d7cd9 100644 --- a/Assets/_Scenes/Main.unity +++ b/Assets/_Scenes/Main.unity @@ -273,6 +273,84 @@ Transform: - {fileID: 10252813} m_Father: {fileID: 0} m_RootOrder: 6 +--- !u!1 &630993819 stripped +GameObject: + m_PrefabParentObject: {fileID: 176468, guid: 198e988adacced646a19f757f6237ae1, type: 2} + m_PrefabInternal: {fileID: 1469146136} +--- !u!82 &630993821 +AudioSource: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 630993819} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: d1c2b1851e3fc7147bf24267eabf01fd, 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: 0 + BypassListenerEffects: 1 + BypassReverbZones: 0 + 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!4 &780956563 stripped Transform: m_PrefabParentObject: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} @@ -601,7 +679,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 11401034, guid: 198e988adacced646a19f757f6237ae1, type: 2} propertyPath: CriticalMax - value: 0.75 + value: 0.9 objectReference: {fileID: 0} - target: {fileID: 11401034, guid: 198e988adacced646a19f757f6237ae1, type: 2} propertyPath: ExplosionParticle