LoginSignup
54
55

More than 5 years have passed since last update.

Unityで開発するときにフォルダ構成と.gitignoreを作る便利スクリプト

Last updated at Posted at 2017-01-05

Unityで開発する時の楽々設定

下記のエントリでUnity開発前に必要な設定項目を説明しているものの、手動で毎回やるのはバカらしいのでスクリプト作りました。

スクリプト

プロジェクト直下に以下のスクリプトを突っ込んで実行して下さい。
上記のエントリで書いてある作業を実行します。
自動的にフォルダ構成と.gitignoreを生成します。

init.sh
#!/bin/sh

function init() {
arr=("Scenes" "Prefabs" "Scripts" "Animations" "Materials" "Physics Materials" "Fonts" "Textures" "Audio" "Resources" "Editor" "Plugins")
for var in "${arr[@]}"; do
  #echo $var
  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 "Run"
  init
fi

Unity側の設定

以下は手動で設定して下さい。

  • [Edit] -> [Project Settings] -> [Editor]を選択
  • Inspectorビューを開く
  • [Version Control] のModeを [Visible Meta Files] に変更
  • [Asset Serialization] のModeを [Force Text] に変更
54
55
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
54
55