Fix a bug:we can use 'Custom Class' in CocosBuilder, and assign custom properties to it, but when you create some nodes with the same custom_class , and they have different custom properties, as they are same class and the share one Loader, so in the loader _customProperties will be wrong.

So, I dropped some lines to clear _customProperties before handle an new node.
This commit is contained in:
Jason Xu 2013-11-11 15:45:07 +08:00
parent 00b477e756
commit 891ddb5018
1 changed files with 5 additions and 1 deletions

View File

@ -29,7 +29,11 @@ Dictionary* NodeLoader::getCustomProperties()
Node * NodeLoader::loadNode(Node * pParent, CCBReader * ccbReader) {
Node * ccNode = this->createNode(pParent, ccbReader);
//this->parseProperties(ccNode, pParent, ccbReader);
//clear _customProperties, ready for load next node.
if (_customProperties != nullptr)
{
_customProperties->removeAllObjects();
}
return ccNode;
}