Skill* Skill::create(Hero* h){ Skill* skill = new Skill(); if(skill && skill->init(h)){ skill->autorelease(); return skill; }else{ CC_SAFE_DELETE(skill); return nullptr; } }
Skill* Skill::createSkill(SkillType skillType) { Skill* skill = new Skill(); if(skill && skill->init(skillType)) { skill->autorelease(); return skill; } CC_SAFE_DELETE(skill); return NULL; }