Re: Class object that is persistent throughout every level?

#3
I know to use the singleton pattern, but I was still curious what object is persistent when the game starts and where the game ends. Because even when creating a C++ Singleton without a persistent context, it will still be removed after the level has been unloaded. Typically in a game engine there's one place where an object (at least 1) is persistent. Correct me if I'm wrong I would like to know more.

Re: Class object that is persistent throughout every level?

#5
There is currently not a way to keep Entities alive between multiple levels. Instead you can use CGamePlugin class in the templates to handle persistent systems for your project. The CGamePlugin will be alive during the whole lifetime of the game.
Ahh yes. Thank you for that @cry-miron ! I mean I can create a singleton class and have it be created in the CGamePlugin for data regardless. Now I know where I can store the singleton, it will be easy to track data throughout the project. Speaking of which, are there any plans to have a persistent object in the future or is it not the best idea for this engine in particular?

Who is online

Users browsing this forum: No registered users and 0 guests