我在我的统一游戏中第一次尝试使用Google实时多人游戏。QuickMatch工作正常,我的意思是我可以使用以下方法获取连接的参与者的ID并将其存储到字符串中:
string MyId = PlayGamesPlatform.Instance.RealTime.GetSelf ().ParticipantId;
//string frndId = PlayGamesPlatform.Instance.RealTime.GetParticipant ();
//Get all opponent's ID
List<Participant> 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 = playerIDs [0].DisplayName.ToString ();
multiplayersName [1].text = "gamehoster" + oppoUsarname;
gameHost = false;
OppoID = playerIDs [0].ParticipantId;
OppoDN = playerIDs [0].DisplayName.ToString ();
}
Run Code Online (Sandbox Code Playgroud)
对手进入房间后,我可以展示他的表情displayname …
我正在学习团结,我想知道...如果有可能将小动画介绍视频或.gif动画添加到统一的闪屏中?如果是,那该怎么办?我试图使用播放器设置更改启动画面,但.gif动画无效.