我已按照http://developers.airconsole.com/#/guides/unity上的说明进行操作,我可以从调试视图开始,也可以不使用调试视图,但似乎根本没有发送任何消息(OnMessage 方法在MonoBehaviour 类永远不会被调用)。有没有办法调试这个问题?
问问题
333 次
1 回答
1
您可以通过将 console.logs 添加到您的 controller.html 来调试控制器。
假设您的控制器上有一个调用 myButtonFunction 的按钮元素。
<button id = "myButton" ontouchstart="myButtonFunction()">Send A Message to Screen</button>
然后在函数中添加一个日志,以查看按钮按下是否正常工作。
var myButtonFunction = function() {
console.log("myButton was pressed");
airconsole.message(AirConsole.SCREEN, "button-pressed");
};
要查看控制器记录的内容,您需要使用启动模式“虚拟控制器”并打开浏览器的开发者控制台。
于 2016-03-03T07:26:05.903 回答