Hello, How do I receive a certain exit code from a Unity game when I close the game? (For example: I have a Windows Forms game launcher, call the game from there and then want to send back an exit code from the game to the launcher if the game gets closed) best regards
well there is always: https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnApplicationQuit.html call some app->site code in there maybe?
Maybe the game than returns some exit value, I don't know, but I need to have influence of the exit code. Atl least true/false or 1/0.
AFAIK, you don't have control of the exit code of the Unity program. You're going to have to solve whatever you're doing in some other way.
Thanks for your answer! Has someone another idea how I can transfer data from the Unity game back to my game launcher? (I have a Windwos Forms C# application as my game launcher and I start the game from there, now I want to send some data back from the game to the launcher. I only need to send two different states, nothing more)
- Create a file, write some data to it, read the data from the other app. - Use some other interprocess communication technique.