HoloLens のUnityアプリで、UWP AppPackageビルド後のバージョンを取得する
UnityのApplication.versionだと、PlayerSettingsのバージョンになってしまう。
AppPackage作成時のインクリメントに対応するには別の方法で取得しないといけない。
そう、こんな感じで
#if !UNITY_EDITOR && UNITY_WSA using Windows.ApplicationModel; #endif private static string GetVersionInfo() { #if !UNITY_EDITOR && UNITY_WSA Package package = Package.Current; PackageId packageId = package.Id; PackageVersion version = packageId.Version; return string.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Build, version.Revision); #else return Application.version; #endif }