我对Google Play游戏插件的统一行为很奇怪。
在我添加我的代码以发送和接收实时消息之后,在游戏之前等候室的UI,弹出一次,离开,没有任何反应(通常我会匹配其他玩家,游戏在第二台设备上运行)。
在我添加我的代码之前,一切正常(屏幕一直停留,直到找到对手,游戏开始)。
我不知道为什么会出现这个问题。
当我点击获得快速匹配(随机匹配)时,这是日志:
I/Unity ( 6389): UnityEngine.Logger:Log(LogType, Object)
I/Unity ( 6389): UnityEngine.Debug:Log(Object)
I/Unity ( 6389): GooglePlayGames.OurUtils.c__AnonStorey15:<>m__D() (at E:\A
pplication\R Hockey\Assets\GooglePlayGames\OurUtils\Logger.cs:59)
I/Unity ( 6389): GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() (at E
:\Application\R Hockey\Assets\GooglePlayGames\OurUtils\PlayGamesHelperObject.cs:
135)
I/Unity ( 6389):
I/Unity ( 6389): (Filename: E Line: 0)
I/Unity ( 6389):
I/Unity ( 6389): [Play Games Plugin DLL] 08/01/17 13:19:21 +02:00 DEBUG: Not
leaving room since showing UI
I/Unity ( 6389): UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Obj
ect)
I/Unity ( 6389): UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String
, Object[])
I/Unity ( 6389): UnityEngine.Logger:Log(LogType, Object)
I/Unity ( 6389): UnityEngine.Debug:Log(Object)
I/Unity ( 6389): GooglePlayGames.OurUtils.c__AnonStorey15:<>m__D() (at E:\A
pplication\R Hockey\Assets\GooglePlayGames\OurUtils\Logger.cs:59)
I/Unity ( 6389): GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() (at E
:\Application\R Hockey\Assets\GooglePlayGames\OurUtils\PlayGamesHelperObject.cs:
135)
I/Unity ( 6389):
I/Unity ( 6389): (Filename: E Line: 0)
I/Unity ( 6389):
I/Unity ( 6389): [Play Games Plugin DLL] 08/01/17 13:19:21 +02:00 DEBUG: Ente
ring internal callback for RealtimeManager#InternalWaitingRoomUICallback
I/Unity ( 6389): UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Obj
ect)
I/Unity ( 6389): UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String
, Object[])
I/Unity ( 6389): UnityEngine.Logger:Log(LogType, Object)
I/Unity ( 6389): UnityEngine.Debug:Log(Object)
I/Unity ( 6389): GooglePlayGames.OurUtils.c__AnonStorey15:<>m__D() (at E:\A
pplication\R Hockey\Assets\GooglePlayGames\OurUtils\Logger.cs:59)
I/Unity ( 6389): GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() (at E
:\Application\R Hockey\Assets\GooglePlayGames\OurUtils\PlayGamesHelperObject.cs:
135)
I/Unity ( 6389):
I/Unity ( 6389): (Filename: E Line: 0)
I/Unity ( 6389):
I/Unity ( 6389): [Play Games Plugin DLL] 08/01/17 13:19:21 +02:00 DEBUG: Show
WaitingRoomUI Response: VALID
I/Unity ( 6389): UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Obj
ect)
I/Unity ( 6389): UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String
, Object[])
I/Unity ( 6389): UnityEngine.Logger:Log(LogType, Object)
I/Unity ( 6389): UnityEngine.Debug:Log(Object)
I/Unity ( 6389): GooglePlayGames.OurUtils.c__AnonStorey15:<>m__D() (at E:\A
pplication\R Hockey\Assets\GooglePlayGames\OurUtils\Logger.cs:59)
I/Unity ( 6389): GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() (at E
:\Application\R Hockey\Assets\GooglePlayGames\OurUtils\PlayGamesHelperObject.cs:
135)
I/Unity ( 6389):
I/Unity ( 6389): (Filename: E Line: 0)
I/Unity ( 6389):
I/Unity ( 6389): [Play Games Plugin DLL] 08/01/17 13:19:21 +02:00 DEBUG: Conn
ecting state ShowWaitingRoomUI: room pcount:1 status: AUTO_MATCHING
I/Unity ( 6389): UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Obj
ect)
I/Unity ( 6389): UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String
, Object[])
I/Unity ( 6389): UnityEngine.Logger:Log(LogType, Object)
I/Unity ( 6389): UnityEngine.Debug:Log(Object)
I/Unity ( 6389): GooglePlayGames.OurUtils.c__AnonStorey15:<>m__D() (at E:\A
pplication\R Hockey\Assets\GooglePlayGames\OurUtils\Logger.cs:59)
I/Unity ( 6389): GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() (at E
:\Application\R Hockey\Assets\GooglePlayGames\OurUtils\PlayGamesHelperObject.cs:
135)
I/Unity ( 6389):
I/Unity ( 6389): (Filename: E Line: 0)
I/Unity ( 6389):
D/dalvikvm( 3322): GC_CONCURRENT freed 3216K, 31% free 17725K/25376K, paused 6ms
+7ms, total 95ms
W/ActivityManager( 2461): `mDVFSHelper.release()
当我使用此行向其他玩家发送消息时,我发现问题出现了:
PlayGamesPlatform.Instance.RealTime.SendMessageToAll (false, bytedata);
为什么这一行会导致UI的弹出?
(当我没有这条线时,一切都恢复正常。但根据github,这条线是发送信息的唯一方法。
答案 0 :(得分:0)
不知道您的代码是什么样的,您可能需要检查以下内容:
PlayGamesPlatform.Activate
一次。进行此调用不会在屏幕上显示任何内容,也不会以任何方式与用户交互。最后,用于解决this post中的错误的解决方法也可能有所帮助。不要致电PlayGamesPlatform.Instance.RealTime.ShowWaitingRoomUI();
在OnRoomSetupProgress(float percent)
。