#!/bin/bash

# https://bonusxp.com/2014/09/fast-platform-switching-in-unity3d/
# $ brew install pidof
# $ chmod +x osxswitchplatform.bash
# ./osxswitchplatform ios
# ./osxswitchplatform android

# Make sure Unity isn't running while we switch directories out from under it.
if [ "$(pidof Unity)" ]; then
	echo "Please quit Unity first"
	exit
fi
 
# Make sure there is no Library directory.
rm -rf Library
 
# Link Library to platform directory
PLATFORM_DIR="${1}Library"
if [ ! -d $PLATFORM_DIR ]; then
  mkdir $PLATFORM_DIR
fi
ln -s $PLATFORM_DIR Library