mirror of https://github.com/axmolengine/axmol.git
Merge pull request #10359 from flamefox/3dattachnode
getAttachNode should failed when there is no bone with name
This commit is contained in:
commit
d5e82521de
|
@ -578,10 +578,13 @@ AttachNode* Sprite3D::getAttachNode(const std::string& boneName)
|
|||
if (_skeleton)
|
||||
{
|
||||
auto bone = _skeleton->getBoneByName(boneName);
|
||||
auto attachNode = AttachNode::create(bone);
|
||||
addChild(attachNode);
|
||||
_attachments[boneName] = attachNode;
|
||||
return attachNode;
|
||||
if (bone)
|
||||
{
|
||||
auto attachNode = AttachNode::create(bone);
|
||||
addChild(attachNode);
|
||||
_attachments[boneName] = attachNode;
|
||||
return attachNode;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
|
Loading…
Reference in New Issue