Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Run custom editor code BEFORE build starts

Discussion in 'Editor & General Support' started by andymads, Feb 12, 2015.

  1. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Seems that Unity needs a way for us to hook in our own editor code before the build process begins.

    There's the PostProcessBuild attribute that does this after a build, and there's the PostProcessScene attribute that allows code to be executed when each scene is built (although I don't know how you tell which particular scene it's doing at the time).

    It would be useful to have a new attribute for this purpose.
     
  2. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    How about using BuildPipeline to make your build. You can do whatever you want before you call that API.
     
  3. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    That is an option - although it's Pro only (which is fine for me). I was really just looking for an equivalent to the PostProcessBuild attribute. I worked out a solution to my original problem but I think I'll make a suggestion in Feedback.
     
    Graham-Dunnett likes this.