LoginSignup
9
7

More than 5 years have passed since last update.

Unity のバージョンを取得する

Last updated at Posted at 2015-10-15

C# スクリプトで Unity バージョンを取得

利用するもの

以下のメンバまたはメソッドで Unity のバージョンを取得できる。

バージョン取得コード例

Debug.Log("---- version info ----");
Debug.Log(UnityEngine.Application.unityVersion);
Debug.Log(UnityEditorInternal.InternalEditorUtility.GetFullUnityVersion());

出力例

---- version info ----
5.2.1p4
5.2.1p4 (9a78a9ce1e6c)

シェルスクリプト (Mac) で Unity バージョンを取得

利用するもの

ちょっと強引ですが、batchモードで起動時の出力からバージョン情報を抽出。

バージョン取得コード例

UNITY_VERSION=`/Applications/Unity/Unity.app/Contents/MacOS/Unity -batchmode -quit -logFile /dev/stdout | grep "Initialize engine version:" | awk '{print $4;}'`
echo "---- version info ----"
echo $UNITY_VERSION

出力例

---- version info ----
5.2.1p4
9
7
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
9
7