Hello, I am aiming to combine my projects into one atlas to improve performance in unity. I have read and followed the docs for using the Command Line Interface to achieve this. I have modified the export.sh script from the examples.
I haven't run it yet. This is my first time executing a script to the CLI, and I'm a bit nervous since I don't fully understand how this works. If someone was kind enough, could you look at this code and let me know if it is correct - and if not, let me know where I've gone wrong?
My main confusion - other than being a total noob to CLI - is whether adding multiple inputs into the Texture Packer is the proper way to do it?
My code:
`#!/bin/sh
#set -e
#SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
#cd "$SCRIPT_DIR"
SPINE_EXE="C:/Program Files/Spine/Spine.com"
if [ ! -f "$SPINE_EXE" ]; then
SPINE_EXE="/mnt/c/Program Files/Spine/Spine.com"
fi
if [ ! -f "$SPINE_EXE" ]; then
SPINE_EXE="/Applications/Spine.app/Contents/MacOS/Spine"
fi
echo "Spine exe: $SPINE_EXE"
if [ "$#" -eq 0 ]; then
echo "Enter the Spine editor version to use for the export (eg 4.1.xx):"
read version
else
version=${1%/}
fi
#echo "Cleaning export directories..."
#rm -rf ../spineboy/export/*
#rm -rf ../spinosaurus/export/*
Export Unity Assets
UNITY_BASE_DIR=../path/to/_MASTERS
if [ -d "$UNITY_BASE_DIR" ]; then
#echo "Cleaning Unity export directories..."
#rm -rf $UNITY_BASE_DIR/spineboy-pro/export/*
#rm -rf $UNITY_BASE_DIR/spineboy-unity/export/*
echo ""
echo "Exporting assets..."
"$SPINE_EXE" \
-u $version \
-i $UNITY_BASE_DIR/MASTER SPINE/Cherimoya Spine/Cherimoya_Stage_1.spine -o $UNITY_BASE_DIR/Temp Export/Cherimoya1 -e binary.json \
-i $UNITY_BASE_DIR/MASTER SPINE/Cherimoya Spine/Cherimoya_Stage_2.spine -o $UNITY_BASE_DIR/Temp Export/Cherimoya2 -e binary.json \
-i $UNITY_BASE_DIR/MASTER SPINE/Cherimoya Spine/Cherimoya_Stage_3.spine -o $UNITY_BASE_DIR/Temp Export/Cherimoya3 -e binary.json \
-i $UNITY_BASE_DIR/MASTER SPINE/Cherimoya Spine/Cherimoya_Stage_4.spine -o $UNITY_BASE_DIR/Temp Export/Cherimoya4 -e binary.json \
echo ""
echo "Packing Atlas..."
"$SPINE_EXE" \
-u $version \
-i $UNITY_BASE_DIR/Temp Export/Cherimoya1 -j $UNITY_BASE_DIR/MASTER SPINE/Cherimoya Spine/Cherimoya_Stage_1.spine, -i $UNITY_BASE_DIR/Temp Export/Cherimoya2 -j $UNITY_BASE_DIR/MASTER SPINE/Cherimoya Spine/Cherimoya_Stage_2.spine, -i $UNITY_BASE_DIR/Temp Export/Cherimoya3 -j $UNITY_BASE_DIR/MASTER SPINE/Cherimoya Spine/Cherimoya_Stage_3.spine, -i $UNITY_BASE_DIR/Temp Export/Cherimoya4 -j $UNITY_BASE_DIR/MASTER SPINE/Cherimoya Spine/Cherimoya_Stage_4.spine, -o $UNITY_BASE_DIR/Temp Import/Cherimoya -n cherimoya-pma -p x_Herb_TexturePackSettings/COMBINED_TexturePackSettings.json \
fi
echo ""
echo "Optimizing PNGs..."
cd ..
find . -iname '*.png' -exec oxipng -q --nx -i 0 -o 4 --strip all {} +
echo ""
echo "Done!"`
Thank you in advance!