Top level automation/scripting/api for unity?

Viewed 75

I have difficulties describing exactly what I want so please be merciful and feel free to direct me in any direction you would find fruitful or pertinent.

I am a new Unity developer. I would like to have a top level script that can do things like run the main program loop. I have my IDE with c# on one hand and then I have to keep going to the GUI to initiate the run. I would like to have this automated.

Is this possible? What is this called in Unity? Which API would I actually be speaking to?

I couldn't really find anything indicative in the documentation.

1 Answers

Not sure what OS you are using, but if you want to automate execution of code in Unity, you could invoke it from Command Line, and even pass it the method that you want to call.

Here is an example for a windows machine:

"C:\Program Files\Unity\Editor\Unity.exe" -quit -batchmode -projectPath "C:\Users\UserName\Documents\MyProject" -executeMethod MyEditorScript.PerformBuild

See the documentation page here for more examples and information: https://docs.unity3d.com/Manual/CommandLineArguments.html

Related