|
| 1 | +#! /bin/sh |
| 2 | +######################################################################## |
| 3 | +# Copyright (c) 2017 Unity Technologies. All rights reserved. |
| 4 | +# NOTICE: All information contained herein is, and remains |
| 5 | +# the property of Unity Technologies Aps. and its suppliers, |
| 6 | +# if any. The intellectual and technical concepts contained |
| 7 | +# herein are proprietary to Unity Technologies Aps. and its |
| 8 | +# suppliers and may be covered by Canadian, U.S. and/or |
| 9 | +# Foreign Patents, patents in process, and are protected |
| 10 | +# by trade secret or copyright law. Dissemination of this |
| 11 | +# information or reproduction of this material is strictly |
| 12 | +# forbidden unless prior written permission is obtained from |
| 13 | +# Unity Technologies Aps. |
| 14 | +# |
| 15 | +######################################################################## |
| 16 | + |
| 17 | +# Configure where Unity is installed |
| 18 | +if [ ! -f "${UNITY_EDITOR_PATH}" ]; then |
| 19 | + UNITY_EDITOR_PATH="/Applications/Unity/Unity.app/Contents/MacOS/Unity" |
| 20 | +fi |
| 21 | +echo "Using UNITY_EDITOR_PATH=${UNITY_EDITOR_PATH}" |
| 22 | + |
| 23 | +# Configure which Unity project to install package |
| 24 | +if [ ! -d "${PROJECT_PATH}" ]; then |
| 25 | + PROJECT_PATH=~/Development/FbxExporters |
| 26 | +fi |
| 27 | +echo "Using PROJECT_PATH=${PROJECT_PATH}" |
| 28 | + |
| 29 | +# Configure where unitypackage is located |
| 30 | +if [ ! -f "${PACKAGE_PATH}" ]; then |
| 31 | + PACKAGE_PATH=`ls -t ${PROJECT_PATH}/FbxExporters_*.unitypackage | head -1` |
| 32 | +fi |
| 33 | +echo "Using PACKAGE_PATH=${PACKAGE_PATH}" |
| 34 | + |
| 35 | +if [ ! -f "${UNITY_EDITOR_PATH}" ]; then |
| 36 | + echo "Unity is not installed in default location" |
| 37 | + exit -1 |
| 38 | +fi |
| 39 | + |
| 40 | +if [ -d "${PROJECT_PATH}/Assets/FbxExporters" ]; then |
| 41 | + echo "Uninstalling previous package" |
| 42 | + rm -rf "${PROJECT_PATH}/Assets/FbxExporters" |
| 43 | +fi |
| 44 | + |
| 45 | +# Install FbxExporters package |
| 46 | +"${UNITY_EDITOR_PATH}" -projectPath "${PROJECT_PATH}" -importPackage ${PACKAGE_PATH} -quit |
| 47 | + |
| 48 | +exit 0 |
0 commit comments