Created
September 7, 2017 10:06
-
-
Save TakaakiIchijo/12ba90e6a1658bd2072ba1b98fbd1918 to your computer and use it in GitHub Desktop.
Unity Development BuildでWindowsだと出力されるpdbファイルを消す(Unity5.4以前向け)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using UnityEditor.Callbacks; | |
using System.IO; | |
using System.Linq; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Debug// | |
/// Unity5.2.4で動作確認// | |
/// </summary> | |
public class PostBuildProcess | |
{ | |
[PostProcessBuild] | |
public static void OnPostProcessBuild(BuildTarget buildTarget, string path) | |
{ | |
if(buildTarget == BuildTarget.StandaloneWindows || buildTarget == BuildTarget.StandaloneWindows64) | |
{ | |
DeletePDBFiles(path); | |
} | |
} | |
static void DeletePDBFiles(string path) | |
{ | |
DirectoryInfo di = new DirectoryInfo(Path.GetDirectoryName(path)); | |
List<FileInfo> files = di.GetFiles("*.pdb", SearchOption.AllDirectories).ToList(); | |
files.ForEach(file => file.Delete()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment