Hi,
I want to extract values from a xml string. I am interestet in some IDs, which are instance IDs of Unity game objects. So I collect them in an array as strings in the first place. Befor I iterate through them, I convert the array to a builtin array. To compare the collected IDs with the ones in my scene I have to convert the strings to integer values, but in the line with parseInt(…) the compiler tells me:
BCE0023: No appropriate version of ‘UnityScript.Lang.UnityBuiltins.parseInt’ for the argument list ‘(Object)’ was found.
But shouldn’t they be strings and not objects? Waht am I doing wrong?
var instanceIDs_Array : Array = new Array();
do {
var errorNavigator = navigator.Clone();
errorNavigator.MoveToFirstChild();
var id : String = errorNavigator.Value;
instanceIDs_Array.Add(id);
}while(navigator.MoveToNext());
var instanceIDs = instanceIDs_Array.ToBuiltin(String);
for(obj in allObjects) {
for(var i : int = 0; i<instanceIDs.length; i++) {
var instanceID : int = parseInt(instanceIDs[i]);
if(instanceID==obj.GetInstanceID()) {
...
}
}
}