Unity Pun 2获取房间娱乐活动而不加入房间

发布于 2025-01-25 21:55:56 字数 153 浏览 3 评论 0原文

我想在我的房间列表中的每个房间旁边有一个小玩家计数,但是使用playercount.text = photonnetwork.playerlist.length.tostring();使用PlayerCount。 不会工作,因为它会返回0,因为您还没有在房间里。

i want to have a little player count next to each room in my room list but getting the playercount using playerCount.text = PhotonNetwork.PlayerList.Length.ToString();
wouldnt work because it will return 0 since you're not in a room yet.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

断桥再见 2025-02-01 21:55:56

房间有一个游戏座位

byte playerCount [获取]该房间中的玩家计数(使用this.players.count)

但是,它似乎与players相抵触上面引用的属性( 使用this.players.count )。

字典< int,player> players [get] 在房间内 ,这是列表也在那个房间里的玩家。

我希望thisroom.playercount能够按预期工作,即使该文档似乎否则陈述。

Room has a PlayerCount property

byte PlayerCount[get] The count of players in this Room (using this.Players.Count)

However, it seems to conflict with the Players property referenced above (using this.Players.Count).

Dictionary<int, Player> Players[get] While inside a Room, this is the list of players who are also in that room.

I would expect thisRoom.PlayerCount to work as expected, even though the documentation seems to state otherwise.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文