5
我有以下的聽衆建立在我的團結場景:UniWebView消息調節/衝突?
ui.OnMessageReceived += (view, message) => {
var path = message.Path;
var action = message.Args ["action"];
if (path == "app") {
if (action == "log") {
Debug.Log ("[W] " + message.Args ["text"]);
}
}
};
而在我的Web視圖我有這樣的日誌功能:
log: function(m) {
window.location.href = 'uniwebview://app?action=log&text=' + m;
}
當我執行下面的代碼,唯一的輸出顯示起來logcat的是測試5和E:
app.log("Echo Test (1)");
app.log("Echo Test (2)");
app.log("Echo Test (3)");
app.log("Echo Test (4)");
app.log("Echo Test (5)");
setTimeout(function() {
app.log("Echo Test (A)");
app.log("Echo Test (B)");
app.log("Echo Test (C)");
app.log("Echo Test (D)");
app.log("Echo Test (E)");
}, 500);
08-16 13:55:20.229 13860 13881 I Unity : [W] Echo Test (5) 08-16 13:55:20.693 13860 13881 I Unity : [W] Echo Test (E)
這是什麼原因造成的?怎麼修復?