UpdateTeams
How do I use Update Teams
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
46 | this.UpdateTeams(); | 1 |
53 | this.UpdateTeams(); | 2 |
59 | public void UpdateTeams() | 3 |
File name: PunTeams.cs
Copy
51 public void OnPhotonPlayerPropertiesChanged(object[] playerAndUpdatedProps)
52 {
53 this.UpdateTeams();
54 }
File name: PunTeams.cs
Copy
59 public void UpdateTeams()
60 {
61 Array enumVals = Enum.GetValues(typeof(Team));
62 foreach (var enumVal in enumVals)
63 {
64 PlayersPerTeam[(Team)enumVal].Clear();
65 }
66
67 for (int i = 0; i < PhotonNetwork.playerList.Length; i++)
68 {
69 PhotonPlayer player = PhotonNetwork.playerList[i];
70 Team playerTeam = player.GetTeam();
71 PlayersPerTeam[playerTeam].Add(player);
72 }
73 }
UpdateTeams 135 lượt xem
Gõ tìm kiếm nhanh...