This commit is contained in:
haitem 2021-01-31 15:31:53 +01:00
commit 93e4d21108
2 changed files with 8 additions and 4 deletions

View File

@ -138,7 +138,7 @@ MonoBehaviour:
clips: clips:
- name: MainTheme - name: MainTheme
clip: {fileID: 8300000, guid: 23f58ffff5e98424b82e0a34bfeb8a77, type: 3} clip: {fileID: 8300000, guid: 23f58ffff5e98424b82e0a34bfeb8a77, type: 3}
volume: 0.5 volume: 0.25
pitch: 1 pitch: 1
loop: 1 loop: 1
source: {fileID: 0} source: {fileID: 0}

View File

@ -73,7 +73,7 @@ public class PlayerManager : MonoBehaviour
{ {
cannotMove = true; cannotMove = true;
playerAnimator.Play("Die"); playerAnimator.Play("Die");
FindObjectOfType<AudioManager>().Play("lose"); //FindObjectOfType<AudioManager>().Play("lose");
} }
if (interact) if (interact)
{ {
@ -86,7 +86,7 @@ public class PlayerManager : MonoBehaviour
)) { )) {
if (Input.GetKeyUp(KeyCode.E)) if (Input.GetKeyUp(KeyCode.E))
{ {
FindObjectOfType<AudioManager>().Play("Pickup"); //FindObjectOfType<AudioManager>().Play("Pickup");
playerAnimator.SetTrigger("Eat"); playerAnimator.SetTrigger("Eat");
interact = false; interact = false;
} }
@ -249,6 +249,7 @@ public class PlayerManager : MonoBehaviour
if (Input.GetAxis("Horizontal") > 0) if (Input.GetAxis("Horizontal") > 0)
{ {
playerAnimator.SetBool("Walk", true); playerAnimator.SetBool("Walk", true);
FindObjectOfType<AudioManager>().Play("Walk");
if (pushPullObject == null) { if (pushPullObject == null) {
playerAnimator.transform.rotation = Quaternion.Lerp( playerAnimator.transform.rotation = Quaternion.Lerp(
playerAnimator.transform.rotation, playerAnimator.transform.rotation,
@ -260,6 +261,7 @@ public class PlayerManager : MonoBehaviour
else if (Input.GetAxis("Horizontal") < 0) else if (Input.GetAxis("Horizontal") < 0)
{ {
playerAnimator.SetBool("Walk", true); playerAnimator.SetBool("Walk", true);
FindObjectOfType<AudioManager>().Play("Walk");
if (pushPullObject == null) if (pushPullObject == null)
{ {
playerAnimator.transform.rotation = Quaternion.Lerp( playerAnimator.transform.rotation = Quaternion.Lerp(
@ -281,7 +283,7 @@ public class PlayerManager : MonoBehaviour
transform.position + transform.position +
(onLadder && activeAbility.Count > 0 && activeAbility[0] == 4 ? (transform.up * speed * Input.GetAxis("Vertical") * Time.deltaTime) : Vector3.zero) + (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) (transform.right * (run ? runSpeed : speed) * Input.GetAxis("Horizontal") * Time.deltaTime)
);; );
} }
void Jump() void Jump()
@ -300,6 +302,7 @@ public class PlayerManager : MonoBehaviour
(transform.up * jump * 10 * Time.deltaTime), (transform.up * jump * 10 * Time.deltaTime),
ForceMode.VelocityChange ForceMode.VelocityChange
); );
FindObjectOfType<AudioManager>().Play("Jump");
} }
} }
} }
@ -365,6 +368,7 @@ public class PlayerManager : MonoBehaviour
speed += power; speed += power;
runSpeed += power; runSpeed += power;
} }
else if (powerType == PowerCubeManager.PowerType.Jumper) else if (powerType == PowerCubeManager.PowerType.Jumper)
{ {