diff --git a/Assets/Scenes/MainGameplayScene.unity b/Assets/Scenes/MainGameplayScene.unity index 66a508e..4117a60 100644 --- a/Assets/Scenes/MainGameplayScene.unity +++ b/Assets/Scenes/MainGameplayScene.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5d191edf558d0b55b1ae30476a4683fb7472518babdcee2b55a20cd972372616 -size 719035 +oid sha256:cd6c2b026d418348f41a0b308c5edda29bf1146439af0f4c10d0263bbc759a20 +size 721162 diff --git a/Assets/Scripts/Behaviours/YeetController.cs b/Assets/Scripts/Behaviours/YeetController.cs index 7fce9b9..5c748c8 100644 --- a/Assets/Scripts/Behaviours/YeetController.cs +++ b/Assets/Scripts/Behaviours/YeetController.cs @@ -9,6 +9,9 @@ public class YeetController : InputBehaviour public GameObject handCarryingPosition; public GameObject parent { get; set; } + public AudioClip[] yeetClips; + public AudioClip[] childClips; + public float yeetVelocity = 5f; public float yeetDuration = 2f; public float windupSpeed = 0.01f; @@ -30,16 +33,21 @@ public class YeetController : InputBehaviour private float m_velocityWindup; private LineRenderer m_lineRenderer; + private AudioSource m_audioSource; private Vector3 preyeetPosition; private void Awake() { m_body = this.gameObject; + m_audioSource = gameObject.AddComponent(); + m_audioSource.spatialBlend = 0f; } public void Hold(GameObject child) { + m_audioSource.clip = childClips[Random.Range(0,childClips.Length)]; + _child = child; _child.transform.parent = parent.transform; _child.GetComponent().held = true; @@ -49,6 +57,8 @@ public class YeetController : InputBehaviour m_YeetAnimator.SetBool("Carry", true); m_YeetAnimator.SetBool("Yeet", true); + + m_audioSource.Play(); } public void Preyeet() @@ -58,10 +68,13 @@ public class YeetController : InputBehaviour m_lineRenderer.material = trajectoryLineMaterial; yeetState = YeetState.Preyeet; + } public void Yeet() { + m_audioSource.clip = yeetClips[Random.Range(0,yeetClips.Length)]; + m_YeetAnimator.SetBool("Yeet", false); m_YeetAnimator.SetBool("Carry", false); @@ -75,6 +88,7 @@ public class YeetController : InputBehaviour m_velocityWindup = 0; Destroy(m_lineRenderer); + m_audioSource.Play(); } void Start() diff --git a/Assets/World Assets/Prefabs/Player.prefab b/Assets/World Assets/Prefabs/Player.prefab index d882e4a..3f5a316 100644 --- a/Assets/World Assets/Prefabs/Player.prefab +++ b/Assets/World Assets/Prefabs/Player.prefab @@ -126,6 +126,28 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: handCarryingPosition: {fileID: 6686278636936064271} + yeetClips: + - {fileID: 8300000, guid: 2d26ecf00011bdb4bbe6e60dba9d889e, type: 3} + - {fileID: 8300000, guid: 3433a5c61eb4b504fa17f8aafefccb94, type: 3} + - {fileID: 8300000, guid: 1ae9673877f8d8b42bd5f21f6719eade, type: 3} + - {fileID: 8300000, guid: 328e04d7b7279924d9651c740b96fc94, type: 3} + - {fileID: 8300000, guid: 5496a947a8ca0374da527b80639444b5, type: 3} + - {fileID: 8300000, guid: d99a663d8274f87468e11d0a31571da0, type: 3} + - {fileID: 8300000, guid: eadecf3df4215304babc9fa1e2753c61, type: 3} + - {fileID: 8300000, guid: e7fc48b2f4dcd424fbc89c8ccd55f954, type: 3} + childClips: + - {fileID: 8300000, guid: ee4f744b7998cfa4681a2114cccbbffa, type: 3} + - {fileID: 8300000, guid: 92840820a14d5c04f929159545a89927, type: 3} + - {fileID: 8300000, guid: 30293052bb2f04f40885097b0185a987, type: 3} + - {fileID: 8300000, guid: 69fe9d828a185d94b951f8110d4e3630, type: 3} + - {fileID: 8300000, guid: 552eb1cef1848d847801e9ebc24a8108, type: 3} + - {fileID: 8300000, guid: a8bd8526a0b1a974c97b57eb97361b49, type: 3} + - {fileID: 8300000, guid: 6ea625b03c5658149a9f6baaf740a104, type: 3} + - {fileID: 8300000, guid: 77f924f591d4bfd43b31e12697b9d50b, type: 3} + - {fileID: 8300000, guid: 4b6b02a34565f174aa0160dace4a71ae, type: 3} + - {fileID: 8300000, guid: b59522269b9ea0e40926001d6ed57bd0, type: 3} + - {fileID: 8300000, guid: e94b59152076fa3438110c323273dd1b, type: 3} + - {fileID: 8300000, guid: 1c23e0594d4849e48bbdd0f8825a87d4, type: 3} yeetVelocity: 20 yeetDuration: 2 windupSpeed: 0.05