UniMatchManager : UniBaseMatchManager

UniBaseMatchManager is the base code for matches, it allows the synchronization of scores, time, and stats, beginning and end of game, without additional code.

Client and Server :

Field

UniMatchManager.timer

allows you to retrieve the match timer at any time.

Method

override void OnStartMatch()

Called when the game starts.

override void OnTimer(int timer)

Called every second, with the time left.

override void OnTeamScore(int blueScore, int redScore)

Called each time the score changes, and gives the total score of both teams.

override void OnEndMatch(StatTeam statBlueTeam, StatTeam statRedTeam)

declares the end of the game, and returns the stats of both teams.

public class StatTeam {
    public int Score;
    public int Kill;
    public int Dead;
    public int Damage;
}

Server :

Field

UniMatchManager.blueTeamStat

Allows to get the stats of the blue team.

UniMatchManager.redTeamStat

Allows to get the stats of the red team.

Method

StartMatch(int time)

Allows to start a match, with the time of this match in seconds.