Solis Ortus
Solis Ortus

Reputation: 48

How to debug AirConsole Unity quick example

I've followed the instructions on http://developers.airconsole.com/#/guides/unity and I am able to start with and without debug view, but it seems that no messages are sent at all (the OnMessage method in the MonoBehaviour class is never called). Is there a way to debug this problem?

Upvotes: 0

Views: 371

Answers (1)

Alice
Alice

Reputation: 335

You can debug the controller by adding console.logs to your controller.html.

Let's assume you have a button element on your controller that calls myButtonFunction.

<button id = "myButton" ontouchstart="myButtonFunction()">Send A Message to Screen</button>  

Then you add a log to the function to see if the button pressing works correctly.

var myButtonFunction = function() {
       console.log("myButton was pressed");
       airconsole.message(AirConsole.SCREEN, "button-pressed");
};

To see what your controller logs, you need to use the Start Mode 'Virtual Controllers' and open your browser's developer console.

Upvotes: 1

Related Questions