Tag: 多人游戏

Google Play游戏实时多人游戏:获取参与者ID并将其存储到字符串中

我在团结游戏中第一次尝试谷歌实时多人游戏。 QuickMatch工作正常,我的意思是我能够获取连接参与者的ID并使用以下方法将其存储到字符串: string MyId = PlayGamesPlatform.Instance.RealTime.GetSelf ().ParticipantId; //string frndId = PlayGamesPlatform.Instance.RealTime.GetParticipant (); //Get all opponent’s ID List playerIDs = PlayGamesPlatform.Instance.RealTime.GetConnectedParticipants (); if (MyId == playerIDs [0].ParticipantId) { oppoUsarname = playerIDs [1].DisplayName.ToString (); multiplayersName [1].text = “nothosting” + oppoUsarname; gameHost = true; OppoID = playerIDs [1].ParticipantId; OppoDN = playerIDs [1].DisplayName.ToString (); } else { oppoUsarname = […]