Investigate and add in better lifecycle support for game entities
bijington opened this issue · 0 comments
bijington commented
Consider letting GameScene
and GameObject
know when child objects are added/removed. Also allow for objects to know when they have been added/removed.
And finally GameScene
should know when it is loaded/unloaded.
Something like:
public class GameScene
{
public void OnGameObjectAdded(IGameObject gameObject);
public void OnGameObjectRemoved(IGameObject gameObject);
public void OnLoaded();
public void OnUnloaded();
}
public class GameObject
{
public void OnGameObjectAdded(IGameObject gameObject);
public void OnGameObjectRemoved(IGameObject gameObject);
public void OnAdded(); // TODO: Parent?
public void OnRemoved();
}