Skip to content

Instantly share code, notes, and snippets.

@xenophy
Created February 5, 2017 17:36
Show Gist options
  • Save xenophy/d17f3922448fe0c4c23734d29a7d5a8e to your computer and use it in GitHub Desktop.
Save xenophy/d17f3922448fe0c4c23734d29a7d5a8e to your computer and use it in GitHub Desktop.
Unity Project Setup .gitignore and Asset directories.
#!/bin/sh
function setup() {
dirs=()
dirs=("${dirs[@]}" "Scenes")
dirs=("${dirs[@]}" "Prefabs")
dirs=("${dirs[@]}" "Scripts")
dirs=("${dirs[@]}" "Animations")
dirs=("${dirs[@]}" "Materials")
dirs=("${dirs[@]}" "Physics Materials")
dirs=("${dirs[@]}" "Fonts")
dirs=("${dirs[@]}" "Textures")
dirs=("${dirs[@]}" "Audio")
dirs=("${dirs[@]}" "Resources")
dirs=("${dirs[@]}" "Editor")
dirs=("${dirs[@]}" "Plugins")
for var in "${dirs[@]}"; do
mkdir Assets/"$var"
done
cat << EOT > .gitignore
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
# Autogenerated VS/MD solution and project files
ExportedObj/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
# Unity3D generated meta files
*.pidb.meta
# Unity3D Generated File On Crash Reports
sysinfo.txt
# Builds
*.apk
*.unitypackage
EOT
}
if [ -e Assets ]; then
echo "Setup .gitignore and Asset directories."
setup
echo "done."
echo ""
echo "You should setup manually folloing steps."
echo ""
echo "1. Open Inspector [Edit] -> [Project Settings] -> [Editor]"
echo "2. [Version Control] Mode to [Visible Meta Files]"
echo "3. [Asset Serialization] Mode to [Force Text]"
echo ""
fi
@xenophy
Copy link
Author

xenophy commented Feb 5, 2017

You should change directory to Unity Project directory, after that you just run following command.

wget https://gist.githubusercontent.com/xenophy/d17f3922448fe0c4c23734d29a7d5a8e/raw/11331ed530436251dad2d2e7b51617d0af9ccba7/setup.sh
chmod 755 setup.sh
./setup.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment