PostprocessBuildPlayer scripts do not fire on windows machines to date, and a pre process script for unity does not exist in the public domain, so here is an editor script which adds two custom buttons to your menu:- Custom Build, and Custom Build-Run. The purpose of this script is to allow you to handle any file copying or amendment to the build folder pre or post build automatically.

The script takes all the information required from the normal build window options into account, when executed manually it allows the user to choose a save path, it then fires a pre-process function before building and post process function after building and the build path is sent as a parameter, from within these functions you can call whatever you heart desires from c# file copying code to calling other applications and sending parameters alongside

Notes:-

There may be a few blanks to fill in with the code below in certain scenarios, I haven’t included all the build application extensions ( as I am unsure of all of them, comment with them if you know better!).

Not sure on compatibilty with Unity Indy?

Could do with a clean up function that deletes unused unity build source files, that sometimes linger in the build directory.

Here’s the code, I hope it helps:-

31272 Total Views 1 Views Today