加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-14 20:40:42 所属栏目:百科 来源:网络整理
导读:sed.sh if [ $# -lt 2 ]; then echo "Usage: $0 {替换的内容} {替换后的内容}"; exit;fiforeachd(){ 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`

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


./sed.sh kCCProgressTimerTypeBar ProgressTimer::Type::BAR
./sed.sh CCRepeatForever RepeatForever
./sed.sh CCString __String

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读