当前位置: 首页 > 编程语言 > C#

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

时间:2023-04-10 19:06:02 C#

C#学习教程:GooglePlayGamesReal-TimeMultiplayerGame:GetParticipantIDandStoreItStoreItinaString首次尝试googlereal-timemultiplayerinunitygames。QuickMatch工作正常,我的意思是我能够获取已连接参与者的ID并将其存储到一个字符串中:stringMyId=PlayGamesPlatform.Instance.RealTime.GetSelf().ParticipantId;//stringfrndId=PlayGamesPlatform.Instance.RealTime.GetParticipant();//获取所有对手的ID列表playerIDs=PlayGamesPlatform.Instance.RealTime.GetConnectedParticipants();if(MyId==playerIDs[0].ParticipantId){oppoUsarname=playerIDs[1].DisplayName.ToString();multiplayersName[1].text="nothosting"+oppoUsarname;游戏主机=真;OppoID=playerIDs[1].ParticipantId;OppoDN=playerIDs[1].DisplayName.ToString();}else{oppoUsarname=playerIDs[0].DisplayName.ToString();multiplayersName[1].text="gamehoster"+oppoUsarname;游戏主机=假;OppoID=playerIDs[0].ParticipantId;OppoDN=playerIDs[0].DisplayName.ToString();进入房间后,我可以显示他的昵称。但是对于CreateWithInvitationScreen我想获得被邀请的(我邀请谁使用邀请屏幕)参与者的ID,即使他们没有接受邀请或连接到房间......谁能告诉我怎么做?以上是C#学习教程:GooglePlayGames实时多人游戏:获取参与者ID并存储在字符串中以共享所有内容。如果对你有用,需要进一步了解C#学习教程,希望大家多多关注。本文收集自网络,不代表立场。如涉及侵权,请点击右侧联系管理员删除。如需转载请注明出处: