【发布时间】:2018-01-31 03:24:02
【问题描述】:
我无法检查参与者是否仍连接到房间。
这是我写的:
bool status=GooglePlayGames.Native.PInvoke.MultiplayerParticipant.AutomatchingSentinel().IsConnectedToRoom();
if (status = true)
{
this.gameObject.GetComponent<Text> ().text = "participant is connected";
}
if (status = false)
{
this.gameObject.GetComponent<Text> ().text = "participant left";
}`
当玩家连接时,会显示“参与者已连接”。
但是当玩家按下主页按钮并返回屏幕时,参与者会调用 OnPeersDisconnected 并离开房间。但对于实际玩家,仍然显示“参与者已连接”。
我如何知道 IsConnectedToRoom() 何时为假?
【问题讨论】:
标签: android unity3d real-time google-play-games multiplayer