Unity Pro: Using custom builds to set data before a build

I’m attempting to build my application by using MenuItem to create new menu build options, which run BuildPipeline.BuildPlayer() to create builds with different settings. Depending on which build I select, I’d like to change some data in various classes and have those changes carry over to the completed build. In essence:

------------
// BuildProcess.cs : Editor class that sets data in BuildData class before creating a build
------------

[MenuItem ("Build Process/iOS English Build")]
public static void iOSEnglishBuild() {
	scenes = new string[] { "Assets/Scenes/myScene.unity" };

    // English version
	BuildData.SetIsInternational(false);
	
	// After data has been set, ready to build!
	BuildPipeline.BuildPlayer(scenes, "Builds/iOS", BuildTarget.iPhone, BuildOptions.AcceptExternalModificationsToPlayer);
}

[MenuItem ("Build Process/iOS International Build")]
public static void iOSInternationalBuild() {
	scenes = new string[] { "Assets/Scenes/myScene.unity" };

    // International version
	BuildData.SetIsInternational(true);
	
	// After data has been set, ready to build!
	BuildPipeline.BuildPlayer(scenes, "Builds/iOS", BuildTarget.iPhone, BuildOptions.AcceptExternalModificationsToPlayer);
}

-----------
// BuildData.cs : Stores data that is set right before building
-----------

using UnityEngine;
using System.Collections;
using System;

[Serializable]
public class BuildData : MonoBehaviour 
{
	// References to descriptions for each region
	[SerializeField] public string[] englishData;
	[SerializeField] public string[] internationalData;
	
	// Are we using an international build?
	[SerializeField] private static bool isInternationalVersion;

    // Set from BuildProcess.cs
	public static void SetIsInternational(bool pIsInternational) 
	{
		isInternationalVersion = pIsInternational;
		Debug.Log("Set isInternational: " + isInternationalVersion);
	}

    // Called at runtime by a class who needs descriptions based on current region
    public string[] GetDescriptions()
    {
		if (isInternationalVersion)
		    return internationalData;
		else
		    return englishData;
    }
}

Both builds are reporting that BuildData’s isInternationalVersion is false. Is this a serialization issue? While doing a build, my debug log shows the data is being set to true, but then shows false once the build is run.

Should I be going about this in a different manner? I’m basically wanting to set certain flags when I select a build that will keep their states when the game is built. This is so that if I want to do, for example, an English vs. International build for my current project, I can just select a build option rather than manually changing some data in various scripts.

I don’t think you can accomplish what you want in this manner. Your best option is Platform Dependent Compliation. Check the bottom of the page under Custom defines. Here is the api for it: