2
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
734 B
C#

using Entitas;
using Game;
public class EntityCreateSystem : IExecuteSystem, IInitializeSystem
{
private IGroup<GameEntity> _entities;
public void Initialize()
{
_entities = Util.GetGroup(GameMatcher.ID);
}
public void Execute()
{
foreach (var entity in _entities)
{
if (entity.iD.Data.IsCreate)
{
Util.CreateEntityReal(entity);
entity.iD.Data.IsCreate = false;
if (entity.iD.Data.CreateCallback != null)
{
entity.iD.Data.CreateCallback(entity);
entity.iD.Data.CreateCallback = null;
}
}
}
}
}