GameObjects
All game objects in the SharpEngine.Core.* libraries follow a certain structure:
- Everything is treated as a
Scene Node. - No object contains a public constructor.
- Constructors are meant to be parameterless.
Initialization of game objects are meant to be used through the static GameObject.Create<T>(T instance) and GameObject.Create<T>(Action<T>? configure) interfaces.
This is so that all objects initialization can be easily reinvoked by the system, and to avoid unintended bugs made with the object initilization syntax.
Note: This behaviour is strict within the engine itlsef, but it is not forced on you the developer.
If you wish to inherit from the `GameObject` class and create a public constructor, you are free to do so.
Life cycle
The life cycle of a game engine is deeply tied to the engine itself. A game object can be loaded on the initialization of the engine, or during runtime.
When a Scene is loaded, all of the game objects defined in that scene will also be loaded in. Similarly, when a scene is unloaded, the game objects will be removed.