Extending the editor

Hey folks, I am working on an editor extension to help my workflow however I cant figure out if there is anything that makes it plausible/easy to use an editor extension to make changes to a code file (easy change but i would rather not try doing it with a file handle) and to things like my android manifest xml file.

Alternatively / as a side note. I am curious if there is anywhere you can do add/edit #define statements without editing a source file. I have a project that has a full version and a lite version and I have a #define LITE that I comment out when it is the full version. What I want to do is define/undefine that based on a toggle switch, but I also want it to change my manifest to edit the end of the package name to be -lite or -full.

Any ideas?

System.IO will be your friend. Profuse use of AssetDatabase.Refresh() after edits.

Eck, was hoping there would be a better way, well at least the #define is the first line and the xml manifest is fairly parse-able (wish it was json though, don’t much like xml)

Thanks for the info though.

Oh about the #define thing. That feature is in Unity 4.