Added Round and Respawnsystem

This commit is contained in:
juliuse98
2021-11-19 14:42:09 +01:00
parent 7299b292a7
commit ad238ac417
27 changed files with 1451 additions and 188 deletions

View File

@@ -5,17 +5,38 @@ using UnityEngine;
public class Team
{
private string name;
private int score;
public int score;
public int teamID;
public int teamSize;
public List<Player> players = new List<Player>();
public Team(string _name, int _score)
public Team(string _name, int TeamID,int TeamSize)
{
name = _name;
score = _score;
teamID = TeamID;
teamSize = TeamSize;
score = 0;
Debug.Log(name + " Team Created!");
Debug.Log(name + " Team Created! Their Team ID is " + teamID);
}
public bool AddPlayer(Player player)
{
if (players.Count < teamSize || teamSize == -1)
{
players.Add(player);
player.team = this;
return true;
}
return false;
}
public string GetTeamName()
public void RemovePlayer(Player player)
{
players.Remove(player);
player.team = null;
}
public string GetTeamName()
{
return name;
}