From 2c9f01a405029123b802b359b90f4dcf08e05191 Mon Sep 17 00:00:00 2001 From: "s3607057 (Angus Niven)" Date: Thu, 10 Oct 2019 13:07:07 +1100 Subject: [PATCH] Applied new respawn logic to falling off the map as well. --- Assets/Scripts/LevelBlocks/Air.cs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Assets/Scripts/LevelBlocks/Air.cs b/Assets/Scripts/LevelBlocks/Air.cs index d3c1ba3..281279a 100644 --- a/Assets/Scripts/LevelBlocks/Air.cs +++ b/Assets/Scripts/LevelBlocks/Air.cs @@ -5,8 +5,6 @@ using UnityEngine; public class Air : ActiveBlock { - private List FallenPlayers = new List(); - public override int GetInitative() { return -1; @@ -15,7 +13,7 @@ public class Air : ActiveBlock public override IEnumerator OnWalkedOnByPlayer(Character player, Vector3 moveDirection) { player.stuck = true; - FallenPlayers.Add(player); + player.respawnNeeded = true; StartCoroutine(player.AnimateToPosition(transform.position + Vector3.down * 10,Character.Animation.Hit, 1)); StartCoroutine(LerpScale(player.transform, Vector3.zero, 1)); @@ -29,16 +27,6 @@ public class Air : ActiveBlock public override IEnumerator OnRoundEnd(PlayerData[] allPlayers) { - - foreach (Character player in FallenPlayers) - { - player.gameObject.SetActive(true); - player.respawnCharacter(transform.position); - - } - - FallenPlayers.Clear(); - isFinished = true; Destroy(gameObject); yield break;