fixed: player no longer holds grapple after dying to projectile
This commit is contained in:
@@ -226,7 +226,7 @@ public class PlayerBehavior : MonoBehaviour
|
||||
void LetGoOfGrapple() {
|
||||
bool currentlyPaused = StateController.Instance.isPaused;
|
||||
if (grapplingRope.isGrappling && !currentlyPaused) {
|
||||
print("currently paused is " + currentlyPaused + ", releasing grapple");
|
||||
// print("currently paused is " + currentlyPaused + ", releasing grapple");
|
||||
if (tambourine != null) {
|
||||
tambourine.GetComponent<TambourineBehavior>().DestroySelf();
|
||||
}
|
||||
@@ -362,7 +362,10 @@ public class PlayerBehavior : MonoBehaviour
|
||||
|
||||
IEnumerator DestroyPlayer() {
|
||||
if (playerIsAlive) {
|
||||
print("destroyPlayer called");
|
||||
if (grapplingRope.isGrappling) {
|
||||
LetGoOfGrapple();
|
||||
}
|
||||
// print("destroyPlayer called");
|
||||
playerIsAlive = false;
|
||||
audioSource.clip = deathSound;
|
||||
audioSource.loop = false;
|
||||
@@ -371,15 +374,8 @@ public class PlayerBehavior : MonoBehaviour
|
||||
|
||||
// animate
|
||||
animator.Play("Die");
|
||||
// yield return new WaitForSeconds(animator.GetCurrentAnimatorStateInfo(0).length);
|
||||
yield return new WaitForSeconds(audioSource.clip.length);
|
||||
|
||||
// this.stateController.SetDeathCanvasActive(true);
|
||||
|
||||
if (grapplingRope.isGrappling) {
|
||||
LetGoOfGrapple();
|
||||
}
|
||||
|
||||
// destroy all tambourines
|
||||
GameObject[] currentTambourines = GameObject.FindGameObjectsWithTag("tambourine");
|
||||
print("tambs found: " + currentTambourines.Length);
|
||||
|
||||
Reference in New Issue
Block a user