Using the prime 31 Game Center plugin which is written in c#.
The response from a listener is a List not an array.
In c# the handler does this:
void playerDataLoaded( List<GameCenterPlayer> players )
{
Debug.Log( "playerDataLoaded" );
foreach( GameCenterPlayer p in players )
//string remotePlayerAlias = p.alias;
Debug.Log( p.alias );
}
What is the Javascript (Unityscript) equivalent of this snippet?
Tried this but no go.
import System.Collections.Generic;
var p: String;
var players = new List.<GameCenterPlayer>();
function playerDataLoaded( players )
{
for(GameCenterPlayer in players){
p = players.Alias;
print("p: "+ p);
}
}
Error: “alias is not a member of Object”