Browse Source

Applied new respawn logic to falling off the map as well.

master
s3607057 (Angus Niven) 4 years ago
parent
commit
2c9f01a405
1 changed files with 1 additions and 13 deletions
  1. +1
    -13
      Assets/Scripts/LevelBlocks/Air.cs

+ 1
- 13
Assets/Scripts/LevelBlocks/Air.cs View File

@ -5,8 +5,6 @@ using UnityEngine;
public class Air : ActiveBlock
{
private List<Character> FallenPlayers = new List<Character>();
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;

Loading…
Cancel
Save