Skip to content

Commit

Permalink
update unity docs to show controller example
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Jun 8, 2014
1 parent 3576d52 commit 454b3b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/unitydocs.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ To send one call NetPlayer.sendCmd

The smartphone's client will receive a 'scored' command with the data. eg. {points: 7}

// On the phone
var someFunctionToHandleScoring = function(data) {
console.log("You scored " + data.points + " points!");
};

gameclient.addEventListener('scored', someFunctionToHandleScoring);


You also need to handle if the player's smartphone disconnects. You do this by adding an
OnDisconnect event handler.

Expand Down

0 comments on commit 454b3b9

Please sign in to comment.