@@ -39,11 +39,12 @@ private void Awake() {
3939
4040 private void OnReady ( string code ) {
4141 AirConsoleLogger . Log ( ( ) => "OnReady: " + code ) ;
42+
4243 //Log to on-screen Console
4344 logWindow . text = "ExampleBasic: AirConsole is ready! \n \n " ;
4445
4546 Time . timeScale = 1.0f ;
46-
47+
4748 //Mark Buttons as Interactable as soon as AirConsole is ready
4849 Button [ ] allButtons = ( Button [ ] ) FindObjectsOfType ( typeof ( Button ) ) ;
4950 foreach ( Button button in allButtons ) {
@@ -53,7 +54,8 @@ private void OnReady(string code) {
5354
5455 private void OnMessage ( int from , JToken data ) {
5556 //Log to on-screen Console
56- logWindow . text = logWindow . text . Insert ( 0 , "Incoming message from device: " + from + ": " + data . ToString ( ) + " \n \n " ) ;
57+ logWindow . text = logWindow . text . Insert ( 0 ,
58+ "Incoming message from device: " + from + ": " + data . ToString ( ) + " \n \n " ) ;
5759
5860 // Rotate the AirConsole Logo to the right
5961 if ( ( string ) data == "left" ) {
@@ -92,7 +94,8 @@ private void OnDisconnect(int device_id) {
9294
9395 private void OnDeviceStateChange ( int device_id , JToken data ) {
9496 //Log to on-screen Console
95- logWindow . text = logWindow . text . Insert ( 0 , "Device State Change on device: " + device_id + ", data: " + data + "\n \n " ) ;
97+ logWindow . text = logWindow . text . Insert ( 0 ,
98+ "Device State Change on device: " + device_id + ", data: " + data + "\n \n " ) ;
9699 }
97100
98101 private void OnCustomDeviceStateChange ( int device_id , JToken custom_data ) {
@@ -124,6 +127,7 @@ private void OnGameEnd() {
124127 private void OnHighScores ( JToken highscores ) {
125128 //Log to on-screen Console
126129 logWindow . text = logWindow . text . Insert ( 0 , "On High Scores " + highscores + " \n \n " ) ;
130+
127131 //logWindow.text = logWindow.text.Insert (0, "Converted Highscores: " + HighScoreHelper.ConvertHighScoresToTables(highscores).ToString() + " \n \n");
128132 }
129133
@@ -197,7 +201,8 @@ public void DisplayNicknameOfFirstController() {
197201 string nicknameOfFirstController = AirConsole . instance . GetNickname ( idOfFirstController ) ;
198202
199203 //Log to on-screen Console
200- logWindow . text = logWindow . text . Insert ( 0 , "The first controller's nickname is: " + nicknameOfFirstController + "\n \n " ) ;
204+ logWindow . text = logWindow . text . Insert ( 0 ,
205+ "The first controller's nickname is: " + nicknameOfFirstController + "\n \n " ) ;
201206 }
202207
203208 private IEnumerator DisplayUrlPicture ( string uri ) {
@@ -227,7 +232,8 @@ public void DisplayProfilePictureOfFirstController() {
227232 string urlOfProfilePic = AirConsole . instance . GetProfilePicture ( idOfFirstController , 512 ) ;
228233
229234 //Log url to on-screen Console
230- logWindow . text = logWindow . text . Insert ( 0 , "URL of Profile Picture of first Controller: " + urlOfProfilePic + "\n \n " ) ;
235+ logWindow . text = logWindow . text . Insert ( 0 ,
236+ "URL of Profile Picture of first Controller: " + urlOfProfilePic + "\n \n " ) ;
231237 StartCoroutine ( DisplayUrlPicture ( urlOfProfilePic ) ) ;
232238 }
233239
@@ -246,7 +252,11 @@ public void DisplayAllCustomDataOfFirstController() {
246252 // go through all properties
247253 foreach ( JProperty prop in ( ( JObject ) data ) . Properties ( ) ) {
248254 logWindow . text = logWindow . text . Insert ( 0 ,
249- "Custom Data on first Controller - Key: " + prop . Name + " / Value:" + prop . Value + "\n \n " ) ;
255+ "Custom Data on first Controller - Key: "
256+ + prop . Name
257+ + " / Value:"
258+ + prop . Value
259+ + "\n \n " ) ;
250260 }
251261 } else {
252262 //If there's only one property, log it to on-screen Console
@@ -310,7 +320,8 @@ public void DisplayNumberOfConnectedControllers() {
310320 //This does not count devices that have been connected and then left,
311321 //only devices that are still active
312322 int numberOfActiveControllers = AirConsole . instance . GetControllerDeviceIds ( ) . Count ;
313- logWindow . text = logWindow . text . Insert ( 0 , "Number of Active Controllers: " + numberOfActiveControllers + "\n \n " ) ;
323+ logWindow . text
324+ = logWindow . text . Insert ( 0 , "Number of Active Controllers: " + numberOfActiveControllers + "\n \n " ) ;
314325 }
315326
316327 public void SetActivePlayers ( ) {
@@ -333,7 +344,8 @@ public void DisplayDeviceIDOfPlayerOne() {
333344 if ( device_id != - 1 ) {
334345 logWindow . text = logWindow . text . Insert ( 0 , "Player #1 has device ID: " + device_id + " \n \n " ) ;
335346 } else {
336- logWindow . text = logWindow . text . Insert ( 0 , "There is no active player # 1 - Set Active Players first!\n \n " ) ;
347+ logWindow . text
348+ = logWindow . text . Insert ( 0 , "There is no active player # 1 - Set Active Players first!\n \n " ) ;
337349 }
338350 }
339351
@@ -371,6 +383,7 @@ public void NavigateToPong() {
371383 public void ShowAd ( ) {
372384 //Display an Advertisement
373385 AirConsole . instance . ShowAd ( ) ;
386+
374387 //Log to on-screen Console
375388 logWindow . text = logWindow . text . Insert ( 0 , "Called ShowAd" + "\n \n " ) ;
376389 }
@@ -470,4 +483,4 @@ private void OnDestroy() {
470483 }
471484#endif
472485 }
473- }
486+ }
0 commit comments