How to tell if the game is running in batchmode?

Is there a way to tell if the game it running in batch mode? What I want do is if the game is running in batchmode, then start the game as a server. If it is not running in batchmode, then let the game connect to a server. Is this possible with only having one project executable or do I need to (should) create I project as the server and one as the client?

2 Answers

2

With help from the forums, doing SystemInfo.graphicsDeviceID == 0 will be true in batch mode/headless mode.

By batching you mean clients? It is possible to have one project. You need have networkview for objects that need to be synchronized over net, and Use RPC to execute functions over the network.

Check this link: http://unity3d.com/support/documentation/ScriptReference/Network-isServer.html