以下の内容はhttps://baba-s.hatenablog.com/entry/2022/02/08/090000より取得しました。


【Unity】Windows IL2CPP ビルドした時に生成される XXXX_BackUpThisFolder_ButDontShipItWithYourGame を自動で削除するエディタ拡張

ソースコード

using System.IO;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;

public sealed class WindowsIL2CPPBuildBackUpThisFolderDeleter
    : 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 backUpThisFolderPath
            = $"{outputDirectoryPath}/{productName}_BackUpThisFolder_ButDontShipItWithYourGame";

        if ( !Directory.Exists( backUpThisFolderPath ) ) return;

        Directory.Delete( backUpThisFolderPath, true );
    }
}

Windows IL2CPP ビルドした時に生成される XXXX_BackUpThisFolder_ButDontShipItWithYourGame は
リリースビルドには含める必要がないためリリースビルド後には自動で削除するエディタ拡張

参考サイト様

a_BackUpThisFolder_ButDontShipItWithYourGame
ゲームのデバッグに必要なデータを格納するフォルダー。
PDB (デバッグ情報) ファイルや、スクリプトから生成された C++ コードなどが含まれます。
このフォルダーは、ビルドを出荷するたびにバックアップする必要がありますが、
再配信しないでください。




以上の内容はhttps://baba-s.hatenablog.com/entry/2022/02/08/090000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14