概要
- BuildPipeline.GetBuildTargetGroup を使用する
- もしくは下記のような拡張メソッドを自作する
using UnityEditor;
public static class BuildTargetExt
{
public static BuildTargetGroup ToBuildTargetGroup( this BuildTarget self )
{
switch ( self )
{
case BuildTarget.StandaloneOSX:
case BuildTarget.StandaloneWindows:
case BuildTarget.StandaloneWindows64:
case BuildTarget.StandaloneLinux64:
return BuildTargetGroup.Standalone;
case BuildTarget.iOS: return BuildTargetGroup.iOS;
case BuildTarget.Android: return BuildTargetGroup.Android;
case BuildTarget.WebGL: return BuildTargetGroup.WebGL;
case BuildTarget.WSAPlayer: return BuildTargetGroup.WSA;
case BuildTarget.PS4: return BuildTargetGroup.PS4;
case BuildTarget.XboxOne: return BuildTargetGroup.XboxOne;
case BuildTarget.tvOS: return BuildTargetGroup.tvOS;
case BuildTarget.Switch: return BuildTargetGroup.Switch;
case BuildTarget.Lumin: return BuildTargetGroup.Lumin;
case BuildTarget.Stadia: return BuildTargetGroup.Stadia;
}
return BuildTargetGroup.Standalone;
}
}