Skip to content

Commit

Permalink
4.0.1: Fixed critical refactoring bug
Browse files Browse the repository at this point in the history
  • Loading branch information
aleverdes committed May 4, 2024
1 parent 302447e commit 0b7afd8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
10 changes: 10 additions & 0 deletions Scripts/Core/EcsModuleContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public interface IEcsModuleContainer
EcsSystemsGroup GetSystemsGroup();

IEnumerable<IEcsSystem> GetAllSystems();

IEcsSystems GetUpdateSystems();
IEcsSystems GetLateUpdateSystems();
IEcsSystems GetFixedUpdateSystems();
}

public sealed class EcsModuleContainer : IEcsModuleContainer
Expand Down Expand Up @@ -83,5 +87,11 @@ public IEnumerable<IEcsSystem> GetAllSystems()
{
return _systemsGroup.GetAllSystems();
}

public IEcsSystems GetUpdateSystems() => _systemsGroup.GetUpdateSystems();

public IEcsSystems GetLateUpdateSystems() => _systemsGroup.GetLateUpdateSystems();

public IEcsSystems GetFixedUpdateSystems() => _systemsGroup.GetFixedUpdateSystems();
}
}
6 changes: 3 additions & 3 deletions Scripts/Core/EcsRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ public EcsRunner(EcsWorld ecsWorld)
public virtual void Tick()
{
foreach (var (_, ecsModuleContainer) in Modules)
ecsModuleContainer.GetSystemsGroup().UpdateSystems.Run();
ecsModuleContainer.GetSystemsGroup().GetUpdateSystems().Run();
}

public virtual void LateTick()
{
foreach (var (_, ecsModuleContainer) in Modules)
ecsModuleContainer.GetSystemsGroup().LateUpdateSystems.Run();
ecsModuleContainer.GetSystemsGroup().GetLateUpdateSystems().Run();
}

public virtual void FixedTick()
{
foreach (var (_, ecsModuleContainer) in Modules)
ecsModuleContainer.GetSystemsGroup().FixedUpdateSystems.Run();
ecsModuleContainer.GetSystemsGroup().GetFixedUpdateSystems().Run();
}

public virtual void Dispose()
Expand Down
4 changes: 4 additions & 0 deletions Scripts/Core/EcsSystemsGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,9 @@ public void Destroy()
_lateUpdateSystems.Destroy();
_fixedUpdateSystems.Destroy();
}

public IEcsSystems GetUpdateSystems() => _updateSystems;
public IEcsSystems GetLateUpdateSystems() => _lateUpdateSystems;
public IEcsSystems GetFixedUpdateSystems() => _fixedUpdateSystems;
}
}

0 comments on commit 0b7afd8

Please sign in to comment.