From 3e9c03c1a5ae28d6ebc6362d0aafa5db4ee09d0b Mon Sep 17 00:00:00 2001 From: GamerClassN7 Date: Sun, 31 Jan 2021 15:20:15 +0100 Subject: [PATCH] Auudio --- Assets/Prefabs/Player.prefab | 2 +- Assets/Scripts/PlayerManager.cs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index baef4fd..cc3939b 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -138,7 +138,7 @@ MonoBehaviour: clips: - name: MainTheme clip: {fileID: 8300000, guid: 23f58ffff5e98424b82e0a34bfeb8a77, type: 3} - volume: 0.5 + volume: 0.25 pitch: 1 loop: 1 source: {fileID: 0} diff --git a/Assets/Scripts/PlayerManager.cs b/Assets/Scripts/PlayerManager.cs index eb1fc7f..a090388 100644 --- a/Assets/Scripts/PlayerManager.cs +++ b/Assets/Scripts/PlayerManager.cs @@ -73,7 +73,7 @@ public class PlayerManager : MonoBehaviour { cannotMove = true; playerAnimator.Play("Die"); - FindObjectOfType().Play("lose"); + //FindObjectOfType().Play("lose"); } if (interact) { @@ -86,7 +86,7 @@ public class PlayerManager : MonoBehaviour )) { if (Input.GetKeyUp(KeyCode.E)) { - FindObjectOfType().Play("Pickup"); + //FindObjectOfType().Play("Pickup"); playerAnimator.SetTrigger("Eat"); interact = false; } @@ -249,6 +249,7 @@ public class PlayerManager : MonoBehaviour if (Input.GetAxis("Horizontal") > 0) { playerAnimator.SetBool("Walk", true); + FindObjectOfType().Play("Walk"); if (pushPullObject == null) { playerAnimator.transform.rotation = Quaternion.Lerp( playerAnimator.transform.rotation, @@ -260,6 +261,7 @@ public class PlayerManager : MonoBehaviour else if (Input.GetAxis("Horizontal") < 0) { playerAnimator.SetBool("Walk", true); + FindObjectOfType().Play("Walk"); if (pushPullObject == null) { playerAnimator.transform.rotation = Quaternion.Lerp( @@ -281,7 +283,7 @@ public class PlayerManager : MonoBehaviour transform.position + (onLadder && activeAbility.Count > 0 && activeAbility[0] == 4 ? (transform.up * speed * Input.GetAxis("Vertical") * Time.deltaTime) : Vector3.zero) + (transform.right * (run ? runSpeed : speed) * Input.GetAxis("Horizontal") * Time.deltaTime) - );; + ); } void Jump() @@ -300,6 +302,7 @@ public class PlayerManager : MonoBehaviour (transform.up * jump * 10 * Time.deltaTime), ForceMode.VelocityChange ); + FindObjectOfType().Play("Jump"); } } } @@ -365,6 +368,7 @@ public class PlayerManager : MonoBehaviour speed += power; runSpeed += power; + } else if (powerType == PowerCubeManager.PowerType.Jumper) {