Is there a function like Start that does whatever is in it when you start up unity?
You can call a static constructor from an editor script:
unity UnityEditor;
[InitializeOnLoad]
public class ExampleClassName
{
static ExampleClassName()
{
// do something when the application starts
}
}
This would also be called after script compilation finishes, so be aware of that.