rc 0.71
This commit is contained in:
+16
-17
@@ -11,30 +11,29 @@ public class NetPlayer : NetworkBehaviour
|
||||
{
|
||||
base.OnStartLocalPlayer();
|
||||
// Count current NetPlayers in the scene
|
||||
NetPlayer[] players = FindObjectsOfType<NetPlayer>();
|
||||
if (players.Length <= 1)
|
||||
{
|
||||
myTeam = Team.Red;
|
||||
CmdSetTeam(Team.Red);
|
||||
}
|
||||
else
|
||||
{
|
||||
myTeam = Team.Blue;
|
||||
CmdSetTeam(Team.Blue);
|
||||
}
|
||||
|
||||
SetMyTeam(GameManager.MyTeam);
|
||||
TeamSpecificEffects.instance.SetTeamSpecificEffects(myTeam);
|
||||
}
|
||||
|
||||
if(myTeam == Team.Blue){
|
||||
CameraEffects.instance.SetUpsideDown(true);
|
||||
void SetMyTeam(Team team){
|
||||
if(isServer){
|
||||
setMyTeam(team);
|
||||
}else{
|
||||
CameraEffects.instance.SetUpsideDown(false);
|
||||
CmdSetTeam(team);
|
||||
setMyTeam(team);
|
||||
}
|
||||
}
|
||||
|
||||
void setMyTeam(Team team){
|
||||
myTeam = team;
|
||||
if (GameManager.instance != null)
|
||||
GameManager.instance.OnMatchPlayerTeamAssigned(team);
|
||||
}
|
||||
|
||||
[Command]
|
||||
void CmdSetTeam(Team team){
|
||||
myTeam = team;
|
||||
if (GameManager.instance != null)
|
||||
GameManager.instance.OnMatchPlayerTeamAssigned(team);
|
||||
setMyTeam(team);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user