mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-30 13:07:10 +01:00
Added Round and Respawnsystem
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user