From ee6f44b22b3d1f222edce7c34d7763d9d8ffb16c Mon Sep 17 00:00:00 2001 From: shakurass Date: Sun, 27 Apr 2014 21:30:19 -0600 Subject: [PATCH] death sounds added. --- Assets/Prefabs/PatronCoolGuy.prefab | 2 + Assets/Prefabs/PatronFatty.prefab | 61 +++++++++++++++++++++++++++++ Assets/Prefabs/PatronTits.prefab | 61 +++++++++++++++++++++++++++++ Assets/Scripts/Patron.cs | 17 ++++---- 4 files changed, 134 insertions(+), 7 deletions(-) diff --git a/Assets/Prefabs/PatronCoolGuy.prefab b/Assets/Prefabs/PatronCoolGuy.prefab index 7a1869a..d903c09 100644 --- a/Assets/Prefabs/PatronCoolGuy.prefab +++ b/Assets/Prefabs/PatronCoolGuy.prefab @@ -160,6 +160,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: characterSprite: {fileID: 21200000} + demonDeath: {fileID: 8300000, guid: 510757768cf12453587e7098af49b584, type: 3} + patronDeath: {fileID: 8300000, guid: d67f8f47c42e54a8482fe86b8c35533e, type: 3} --- !u!114 &11400002 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Prefabs/PatronFatty.prefab b/Assets/Prefabs/PatronFatty.prefab index ef000c9..b995a2c 100644 --- a/Assets/Prefabs/PatronFatty.prefab +++ b/Assets/Prefabs/PatronFatty.prefab @@ -30,6 +30,7 @@ GameObject: - 54: {fileID: 5400000} - 136: {fileID: 13600000} - 114: {fileID: 11400002} + - 82: {fileID: 8200000} m_Layer: 0 m_Name: PatronFatty m_TagString: Untagged @@ -75,6 +76,64 @@ Rigidbody: m_Interpolate: 0 m_Constraints: 0 m_CollisionDetection: 0 +--- !u!82 &8200000 +AudioSource: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100002} + m_Enabled: 1 + serializedVersion: 3 + m_audioClip: {fileID: 8300000, guid: d67f8f47c42e54a8482fe86b8c35533e, type: 3} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + 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 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 --- !u!95 &9500000 Animator: serializedVersion: 2 @@ -113,6 +172,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: characterSprite: {fileID: 21200000} + demonDeath: {fileID: 8300000, guid: 510757768cf12453587e7098af49b584, type: 3} + patronDeath: {fileID: 8300000, guid: d67f8f47c42e54a8482fe86b8c35533e, type: 3} --- !u!136 &13600000 CapsuleCollider: m_ObjectHideFlags: 1 diff --git a/Assets/Prefabs/PatronTits.prefab b/Assets/Prefabs/PatronTits.prefab index e6744ba..cd0fdcc 100644 --- a/Assets/Prefabs/PatronTits.prefab +++ b/Assets/Prefabs/PatronTits.prefab @@ -30,6 +30,7 @@ GameObject: - 54: {fileID: 5400000} - 136: {fileID: 13600000} - 114: {fileID: 11400000} + - 82: {fileID: 8200000} m_Layer: 0 m_Name: PatronTits m_TagString: Untagged @@ -75,6 +76,64 @@ Rigidbody: m_Interpolate: 0 m_Constraints: 0 m_CollisionDetection: 0 +--- !u!82 &8200000 +AudioSource: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 100002} + m_Enabled: 1 + serializedVersion: 3 + m_audioClip: {fileID: 8300000, guid: d67f8f47c42e54a8482fe86b8c35533e, type: 3} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + 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 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 --- !u!95 &9500000 Animator: serializedVersion: 2 @@ -101,6 +160,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: characterSprite: {fileID: 21200000} + demonDeath: {fileID: 8300000, guid: 510757768cf12453587e7098af49b584, type: 3} + patronDeath: {fileID: 8300000, guid: d67f8f47c42e54a8482fe86b8c35533e, type: 3} --- !u!114 &11400002 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Scripts/Patron.cs b/Assets/Scripts/Patron.cs index 8be5c83..8eb6db6 100644 --- a/Assets/Scripts/Patron.cs +++ b/Assets/Scripts/Patron.cs @@ -3,6 +3,8 @@ using System.Collections; public class Patron : MonoBehaviour { public Renderer characterSprite; + public AudioClip demonDeath; + public AudioClip patronDeath; private GameController gameController; private bool isDemon = false; @@ -23,15 +25,16 @@ public class Patron : MonoBehaviour { //Instantiate(explosion, transform.position, transform.rotation); if (other.tag == "Shank") { - //Instantiate (playerExplosion, other.transform.position, other.transform.rotation); - //gameObject.audio.Play (); - Destroy(gameObject); - - - if(isDemon) + if(isDemon) { + AudioSource.PlayClipAtPoint (demonDeath, gameObject.rigidbody.position); gameController.AddScore (); - else + } + else { + AudioSource.PlayClipAtPoint (patronDeath, gameObject.rigidbody.position); gameController.DetractScore (); + } + + Destroy(gameObject); } if (other.tag == "VVAura" && isDemon) {