Ejemplo n.º 1
0
        public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
        {
            var fileName = Path.GetFileName(pathToBuiltProject);
            var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(pathToBuiltProject);

            if (string.IsNullOrEmpty(fileName))
            {
                Debug.Log("BuildPostprocessor.OnPostprocessBuild: Can't find exe!"); return;
            }

            var dataPath = pathToBuiltProject.Remove(pathToBuiltProject.Length - fileName.Length, fileName.Length) + fileNameWithoutExtension + "_Data";

            // TODO : Other platforms support...
            if (target == BuildTarget.StandaloneWindows || target == BuildTarget.StandaloneWindows64)
            {
                var pureBuildPath = Path.GetDirectoryName(pathToBuiltProject);

                if (string.IsNullOrEmpty(pureBuildPath))
                {
                    Debug.Log("BuildPostprocessor.OnPostprocessBuild: Can't find pure build path!"); return;
                }

                foreach (var path in Directory.GetFiles(pureBuildPath, "*Log*.txt"))
                {
                    if (File.Exists(path))
                    {
                        File.Delete(path);
                    }
                }
            }

            Directory.CreateDirectory(PathGlobals.GlobalModFolderPathEditor(dataPath));
            Directory.CreateDirectory(PathGlobals.GlobalConfigFolderPathEditor(dataPath));
        }
Ejemplo n.º 2
0
    public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
    {
        var exeName   = Path.GetFileName(pathToBuiltProject);
        var exeNameWE = Path.GetFileNameWithoutExtension(pathToBuiltProject);

        var dataPath = pathToBuiltProject.Remove(pathToBuiltProject.Length - exeName.Length, exeName.Length) + exeNameWE + "_Data";

        if (target == BuildTarget.StandaloneWindows || target == BuildTarget.StandaloneWindows64)
        {
            var pureBuildPath = Path.GetDirectoryName(pathToBuiltProject);

            foreach (string file in Directory.GetFiles(pureBuildPath, "*.pdb"))
            {
                if (File.Exists(file))
                {
                    File.Delete(file);
                }
            }

            foreach (string file in Directory.GetFiles(pureBuildPath, "*Log*.txt"))
            {
                if (File.Exists(file))
                {
                    File.Delete(file);
                }
            }
        }

        Directory.CreateDirectory(PathGlobals.GlobalModFolderPathEditor(dataPath));
        Directory.CreateDirectory(PathGlobals.GlobalConfigFolderPathEditor(dataPath));
    }