Custom Defines Manager

Description
Script for adding/removing #define's in Unity that are dependent on a file. When that file exists, this script will create the desired defines for it. When that file is removed, those defines will be removed.

Unity does not support standard #define's, but they can be added to each build type's player settings using editor scripts (http://docs.unity3d.com/Manual/PlatformDependentCompilation.html) to allow #if and #elif preprocessor directives for platform dependent code. Of course it is often more useful to create your own, so this script simplifies that process, especially for imported assets.

Usage
Simply add a new AssetDefine object to the list of CustomDefines that the manager uses in your project. The AssetDefine requires a file to be dependent on, and at least 1 define for that dependency. You may define as many additional defines as you wish. Optionally, you may replace the null, with a list of the platforms you wish your define to work for

Usage for Assets
It is recommended to to rename AssetDefineManager to something like MyAssetNameDefineManager, so that it does not interfere if another asset should use this script.

With an asset, it is easy to include this file along with your asset, then allow the manager to have the define based on the Manager existing. It will properly handle the creation of the defines when your asset is added, and the removal if your asset is deleted from the project.

Note about deleting the manager file
If the manager has a define dependency file set as the manager file itself, it WILL properly handle it's own deletion. This is because Unity runs all AssetPostProcessors THEN recompiles scripts, meaning that the manager will properly remove the defines that depend on itself.