ソースコード
using System.IO;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
public sealed class SteamworksNetTxtDeleter : IPostprocessBuildWithReport
{
public int callbackOrder => 0;
public void OnPostprocessBuild( BuildReport report )
{
var summary = report.summary;
var platform = summary.platform;
if ( platform != BuildTarget.StandaloneWindows &&
platform != BuildTarget.StandaloneWindows64 )
{
return;
}
if ( summary.options.HasFlag( BuildOptions.Development ) ) return;
var outputPath = summary.outputPath;
var outputDirectoryPath = Path.GetDirectoryName( outputPath );
var productName = PlayerSettings.productName;
var steamworksNetTxtPath = $"{outputDirectoryPath}/{productName}_Data/Plugins/Steamworks.NET.txt";
EditorApplication.delayCall += () =>
{
if ( !File.Exists( steamworksNetTxtPath ) ) return;
File.Delete( steamworksNetTxtPath );
};
}
}