0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

MacでUnityプロジェクトをコマンドラインから開く

0
Posted at

.zshrcなどに

open_unity_editor() {
  vf="ProjectSettings/ProjectVersion.txt"
  [ -f "$vf" ] || { echo "$vf not found"; return 1; }

  ver=$(awk -F': ' '/m_EditorVersion:/ {print $2}' "$vf")
  [ -n "$ver" ] || { echo "Unity version not found in $vf"; return 1; }

  app="/Applications/Unity/Hub/Editor/$ver/Unity.app"
  [ -d "$app" ] || { echo "Unity $ver not installed at $app"; return 1; }

  open -a "$app" --args -projectPath "$(pwd)"
}

# お好みで
alias unity="open_unity_editor"

使い方

cd して、 open_unity_editor (もしくはaliasのunity) するだけです。

% cd UnityProject
% open_unity_editory

参考

これをそのままmac版にしただけです。有益な情報をありがとうございます!

0
1
0

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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?