I was wondering if anyone could help me with this script I am trying to convert, I just can’t get it working.
I’m working on an iPhone game and the code I’m trying to convert is from a plugin that allows access to the iPod music controls.
The C# example script to list playlists goes like this -
At the moment, my converted code looks like this -
for( var playlist : playlist in playlists ){
Debug.Log( playlist );
}
and I’m getting this error - The name ‘playlist’ does not denote a valid type (‘not found’).
I know it’s all wrong but I just cant figure out where the problem is. If i dont declare the playlist type i get Unknown identifier: ‘playlists’. I think these custom types are confusing me…
Could Someone point me in the right direction here?
Thanks
Pete
This isnt’ a solution but maybe a direction of help.
Is there a way to look into the return value of the function at all? If not try and print the playlists to the log to see what is being sent through, it’s possibly a string if it’s the name of the playlist or object/array if it’s the song names in the playlist.
A cursory look at this would imply that you have not declared playlist as an equivalent to a MediaPlayerPlayList in Unity.
As Tilluss says, this could be a list of names of tracks or a list of the track objects themselves.
As mentioned here “playlists” is a list of MediaPlayerList. The thing which follows ‘:’ in javascript is the type and playlist ( which you have typed after ‘:’ is not a type. It should work if you replace playlist with MediaPlayList.