diff options
Diffstat (limited to 'Assets/Scripts/Actors/Player.cs')
-rw-r--r-- | Assets/Scripts/Actors/Player.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Assets/Scripts/Actors/Player.cs b/Assets/Scripts/Actors/Player.cs index 8535a41..4adcfd9 100644 --- a/Assets/Scripts/Actors/Player.cs +++ b/Assets/Scripts/Actors/Player.cs @@ -32,7 +32,7 @@ namespace MontanaJohns.Actors jump.started += context => Jump(); use.started += context => Use(); - attack.started += context => Fire(); + //attack.started += context => Fire(); cancel.started += context => Cancel(); } @@ -48,7 +48,13 @@ namespace MontanaJohns.Actors protected void Update() { ((IFollowable)this).Follow(); - if(isGrappling) + DeathCheck(); + } + + protected override void FixedUpdate() + { + base.FixedUpdate(); + if (isGrappling) { base.Grapple(move.ReadValue<Vector2>().x, move.ReadValue<Vector2>().y, (Vector2)grapplePoint); } @@ -58,7 +64,6 @@ namespace MontanaJohns.Actors if (isMoving && !_animator.GetBool("airborn") && !_audio.isPlaying("RunningOnGrass")) _audio.Play("RunningOnGrass"); else if (!isMoving || _animator.GetBool("airborn")) _audio.Stop("RunningOnGrass"); } - DeathCheck(); } protected void DeathCheck() @@ -66,6 +71,8 @@ namespace MontanaJohns.Actors if(health <= 0) { MainCamera.GetComponent<LevelController>().ResetLevel(); + if (isGrappling) + Use(); ResetStats(); health = stats.maxHealth; transform.position = spawnPoint; |