首页 > 其他 > 详细

cocos2.x升级到3.x的脚本

时间:2015-03-24 14:57:17      阅读:118      评论:0      收藏:0      [点我收藏+]

sed.sh 

if [ $# -lt 2 ]; then

    echo "Usage: $0 {替换的内容} {替换后的内容}";
    exit;

fi

foreachd()
{
    i=0;
    for file in $1/*;  do  
        if [ -d $file ]; then
            foreachd $file;
        elif [ -f $file ]; then
            echo $file;
            if [[ $file == *png ]]; then 
                $i=`expr $i + 1`;
                echo "$i";
                mv $file $2$i.png;
            fi  
        fi  
    done
}


#foreachd $1 $2;



find . -name "*.cpp" -exec sed -i -e "s/$1/$2/g" {} \;
find . -name "*-e" -exec rm {} \;

find . -name "*.h" -exec sed -i -e "s/$1/$2/g" {} \;
find . -name "*-e" -exec rm {} \;



执行命令(注意一定要在Class目录执行,避免替换引擎本身的代码


./sed.sh CCLabelTTF LabelTTF
./sed.sh CCLabelTTF LabelTTF
./sed.sh CCSize Size
./sed.sh CCAnimate Animate
./sed.sh sharedNotificationCenter getInstance
./sed.sh CCLabelBMFont LabelBMFont
./sed.sh ccYELLOW Color3B::YELLOW
./sed.sh Scale9Sprite ui::Scale9Sprite
./sed.sh spriteFrameByName getSpriteFrameByName
./sed.sh setFlipY setFlippedY
./sed.sh ccc4 Color4B
./sed.sh CCControlButton ControlButton
./sed.sh ccTouchBegan TouchBegan
./sed.sh StringUtils StringUtil
./sed.sh CCScale9Sprite CCScale9Sprite
./sed.sh CCScrollView ScrollView
./sed.sh CCControlEventTouchUpInside Control::EventType::TOUCH_UP_INSIDE
./sed.sh CCTouch Touch
./sed.sh CCEvent Event
./sed.sh CCSpriteFrameCache SpriteFrameCache
./sed.sh sharedSpriteFrameCache getInstance
./sed.sh CCTextureCache TextureCache
./sed.sh sharedTextureCache getInstance
./sed.sh ccTouch Touch
./sed.sh CCStringMake String             
./sed.sh (ccp( (Point(
./sed.sh CCSprite Sprite
./sed.sh CCNode Node
./sed.sh CCLayer Layer
./sed.sh CCObject Ref
./sed.sh CCTouch Touch
./sed.sh CCEvent Event
./sed.sh CCControlStateNormal Control::State::NORMAL
./sed.sh CCControlStateHighlighted Control::State::HIGH_LIGHTED
./sed.sh CCControlStateDisabled Control::State::DISABLED
./sed.sh CCControlEventTouchDown Control::EventType::TOUCH_DOWN
./sed.sh CCAction Action
./sed.sh ccp Point
./sed.sh CCSequence Sequence
./sed.sh CCMoveBy MoveBy
./sed.sh CCEaseOut EaseOut
./sed.sh CCPoint Point
./sed.sh CCCallFuncN CallFuncN
./sed.sh PointAdd ccpAdd
./sed.sh PointSub ccpSub
./sed.sh PointSub ccpSub
./sed.sh CCDirector::sharedDirector Director::getInstance
./sed.sh CCScene Scene

cocos2.x升级到3.x的脚本

原文:http://blog.csdn.net/epeaktop/article/details/44590269

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!