Execute Unity method on running Unity process (windows)

Hi there.

I’m glad to see that Unity now supports headless mode and command line arguemnts. I was hoping to be able to exploit the same kind of functionality while Unity is running (since I generally want to do this particular task while Unity is up). Would such a thing be possible? I would like to do it over CLI, or I could write another program to do it.

Hey i had the same problem for some ago and i made a little hack around for this, however, this hack is only tested on windows but go show it some love should still work just fine: http://forum.unity3d.com/threads/141957-Windowed-Maximized-option

Yeah I’m pretty sure user32.dll is a part of the Windows SDK, so it will never work cross-platform. What I came up with was actually the following:

The bridge script that Git calls writes a file called merges.txt to the root of the Assets folder.
If I have a certain editor window up, with the following in it’s Update() function:

TextAsset mergeFile = (TextAsset)AssetDatabase.LoadAssetAtPath(messagePath, typeof(TextAsset));
if(mergeFile) {
	AssetDatabase.DeleteAsset(messagePath);
	//Do merge
}