我正试图通过2名阿雷拉主义者(所谓的现场物体和动画物体)播音,并根据一个名称领域对这两个人进行对比。 我的法典如下:
Iterator<AnimationObject> itr = animationObjects.iterator();
Iterator<SceneObject> itrMain = sceneObjects.iterator();
while (itr.hasNext()) {
AnimationObject object = itr.next();
//Remove the word node from the animation object name so it matches main object name.
String tmpString = object.animationobjectName.replace("node-", "");
System.out.println("Animation Object name is" +tmpString);
while (itrMain.hasNext()) {
SceneObject objectMain = itrMain.next();
System.out.println("Scene Object name is" +objectMain.objectName);
if (tmpString.equals(objectMain.objectName)) {
System.out.println("Animation Object matched to main object array" +tmpString);
objectMain.animations = object.animationData;
objectMain.hasAnimations = true;
}
}
}
The problem is that the code isn t working as intended - it only compares the first item in the itr iterator to the values of the itrMain iterator.
谁能发现我会错过什么?
谢谢。