Managed the freeing of entityplacers. Also cleaned up EntityManager
This commit is contained in:
@@ -10,9 +10,17 @@ public partial class TrashEntityPlacer : Node2D
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
TrashEntity entity = new TrashEntity();
|
||||
entity.sceneName = EntityManager.Instance.CurrentEntitySceneContainer!.sceneName;
|
||||
entity.position = GlobalPosition;
|
||||
EntityManager.Instance.AddEntity(entity);
|
||||
string sceneName = EntityManager.Instance.CurrentEntitySceneContainer!.sceneName;
|
||||
var loadedScenesEntity = EntityManager.Instance.GetUniqueEntity<LoadedScenesEntity>();
|
||||
|
||||
if (!loadedScenesEntity.WasSceneLoaded(sceneName))
|
||||
{
|
||||
TrashEntity entity = new TrashEntity();
|
||||
entity.sceneName = sceneName;
|
||||
entity.position = GlobalPosition;
|
||||
EntityManager.Instance.AddEntity(entity);
|
||||
}
|
||||
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user