Puflo Posted March 22, 2018 Share Posted March 22, 2018 How can I call a function when Game state is shutting down? To be more specific, I want to close a connection when the game is switching to another state. Link to comment Share on other sites More sharing options...
onlycape Posted March 22, 2018 Share Posted March 22, 2018 Hi @Puflo , The StateManager (via 'state') have a property for that: onShutDownCallback. Link to comment Share on other sites More sharing options...
samme Posted March 23, 2018 Share Posted March 23, 2018 Just define a method named shutdown on the state. Link to comment Share on other sites More sharing options...
Recommended Posts