小编Sum*_*Pal的帖子

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

我在我的统一游戏中第一次尝试使用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 …

c# multiplayer unity-game-engine google-play-games

5
推荐指数
0
解决办法
222
查看次数

是否可以将动画介绍添加到统一的闪屏中.

我正在学习团结,我想知道...如果有可能将小动画介绍视频或.gif动画添加到统一的闪屏中?如果是,那该怎么办?我试图使用播放器设置更改启动画面,但.gif动画无效.

unity-game-engine unity5

1
推荐指数
1
解决办法
3280
查看次数