0

For instance, I have some documentation generator and I want Unity to generate fresh docs (execute it) after every compilation. How do I do this?

1 Answer 1

2

You can use a post build script.

Unity will call any c# editor class method marked as PostProcessBuildAttribute.

Eg:

public class MyBuildPostprocessor {
    [PostProcessBuildAttribute(1)]
    public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) {
        // Execute your external script here
        // Eg: ProcessStartInfo proc = new ProcessStartInfo();
        }
}

Or use the older (Mac only) PostprocessBuildPlayer shell script in your Editor folder which is also called at the end of the build.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.