private static void Build(BuildTarget target, ActionAfterBuild action) { PlayerSettings.runInBackground = false; var separator = Path.DirectorySeparatorChar; var platform = target.Name(); var directory = DirectoryName(platform); var path = Directory + separator + directory + separator + ProjectName + target.Extension(); var message = BuildPipeline.BuildPlayer(Levels, path, target, BuildOptions.None); if (string.IsNullOrEmpty(message)) { Debug.Log(platform + " build complete"); MakeAction(action, target); } else { Debug.LogError("Error building " + platform + ":\n" + message); } }
private static string DirectoryName(BuildTarget target) { return(DirectoryName(target.Name())); }