cocos2d CCDictionary

前端之家收集整理的这篇文章主要介绍了cocos2d CCDictionary前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
//1.先拿到关卡 int level = CCUserDefault::sharedUserDefault()->getIntegerForKey("LEVEL"); const char *curlevel = CCString::createWithFormat("config/level_%d.plist",level)->getCString(); //2.再拿到配置 CCDictionary * pDict = CCDictionary::createWithContentsOfFile(curlevel); CCDictionary * items = (CCDictionary *)pDict->objectForKey("items"); CCDictionary * ID = (CCDictionary *)items->objectForKey("1"); CCString* pStr = (CCString*)ID->objectForKey("NUM"); addItem(Mine_gold,Size_small,pStr->intValue()); 原文链接:https://www.f2er.com/cocos2dx/340998.html

猜你在找的Cocos2d-x相关文章