#!/bin/bash TP="/usr/local/bin/TexturePacker" sourceDir=../../Arts/* dstAniDir=ani_1 rm -rf "$dstAniDir" rm ani_1/sd/aniList.txt mkdir "$dstAniDir" mkdir "$dstAniDir"/hd mkdir "$dstAniDir"/sd echo "正在生成高清动画 hd..." for aniDirName in $sourceDir do if [ -d "$aniDirName" ] then var="$aniDirName" aniName=${var##*Arts/} aniName=${aniName//\//_} echo "Animation Name: " $aniName ${TP} --smart-update \ --format cocos2d \ --data "$dstAniDir"/hd/"$aniName"-hd.plist \ --sheet "$dstAniDir"/hd/"$aniName"-hd.png \ --replace .*\/=\ --max-height 1024\ --max-width 1024\ --dither-fs\ "$aniDirName" fi done echo "正在生成标清动画 sd..." for aniDirName in $sourceDir do if [ -d "$aniDirName" ] then var="$aniDirName" aniName=${var##*Arts/} aniName=${aniName//\//_} ${TP} --smart-update \ --format cocos2d \ --data "$dstAniDir"/sd/"$aniName".plist \ --sheet "$dstAniDir"/sd/"$aniName".png \ --replace .*\/=\ --max-height 1024\ --max-width 1024\ --scale 0.5\ --dither-fs\ "$aniDirName" echo "$aniName".plist >> ani_1/sd/aniList.txt fi done exit 0