- Home /
Question by
ShawnFeatherly · Mar 27, 2015 at 04:05 PM ·
unitypackage
Clean up unitypackage with editor script
I'd like to make an editor script that modifies *.cs files. I want it to do a regex type of search and replace. This search will remove lines from the code such as "// TODO:". I'm want this so that the code in an exported unitypackage will look cleaner.
Is there any way to do this kind of automated clean up with editor scripts? Is there a good alternative?
Comment
Answer by ShawnFeatherly · Mar 27, 2015 at 05:35 PM
You'd first handle access to the *.cs files using something similar to: http://answers.unity3d.com/questions/12599/editor-script-need-to-create-class-script-automati.html
Then you can do the regex parsing using something similar to: http://stackoverflow.com/questions/3524317/regex-to-strip-line-comments-from-c-sharp
Your answer
