Skip to content

Commit

Permalink
adds an end-of-frame system group and tooltips for some Bootstrapper …
Browse files Browse the repository at this point in the history
…fields
  • Loading branch information
tbg10101 committed Jan 5, 2021
1 parent b090618 commit 5a67cfc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
15 changes: 15 additions & 0 deletions Runtime/Scripts/MonoBehaviours/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,28 @@ public class Bootstrapper : WorldBehaviour {
private readonly List<EntityArchetype> _archetypes = new List<EntityArchetype>();
private readonly Dictionary<ArchetypeProducer, int> _archetypeProducerIndices = new Dictionary<ArchetypeProducer, int>();

[Tooltip("Systems that execute before each simulation tick. (executed 0-n times per frame)")]
[SerializeField]
private SystemTypeReference[] _simulationResetSystems = new SystemTypeReference[0];

[Tooltip("Systems that execute during each simulation tick. (executed 0-n times per frame)")]
[FormerlySerializedAs("_simulationSystems")]
[SerializeField]
private SystemTypeReference[] _mainSimulationSystems = new SystemTypeReference[0];

[Tooltip("Systems that execute before the ManagedMonoBehaviours. (executed once per frame)")]
[FormerlySerializedAs("_presentationSystems")]
[SerializeField]
private SystemTypeReference[] _presentationPreUpdateSystems = new SystemTypeReference[0];

[Tooltip("Systems that execute after the ManagedMonoBehaviours. (executed once per frame)")]
[SerializeField]
private SystemTypeReference[] _presentationPostUpdateSystems = new SystemTypeReference[0];

[Tooltip("Systems that execute at the end of each frame. Useful for systems that serialize the world. (executed once per frame)")]
[SerializeField]
private SystemTypeReference[] _endOfFrameSystems = new SystemTypeReference[0];

protected virtual void Start() {
// set up simulation systems
SimulationSystemGroup simGroup = AddSystem(typeof(FixedUpdate), new SimulationSystemGroup());
Expand Down Expand Up @@ -109,6 +117,13 @@ protected virtual void Start() {
AddSystem(presGroup, new PrefabSpawnSystem(this));

AddSystem(presGroup, new EndOfFrameEntityCommandBufferSystem());

EndOfFrameSystemGroup endOfFrameGroup = AddSystem(presGroup, new EndOfFrameSystemGroup());
{
foreach (SystemTypeReference systemTypeReference in _endOfFrameSystems) {
GetOrCreateSystem(endOfFrameGroup, systemTypeReference.SystemType);
}
}
}

// set up archetypes
Expand Down
3 changes: 3 additions & 0 deletions Runtime/Scripts/Systems/Groups/EndOfFrameSystemGroup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Software10101.DOTS.Systems.Groups {
internal sealed class EndOfFrameSystemGroup : ListComponentSystemGroup { }
}
3 changes: 3 additions & 0 deletions Runtime/Scripts/Systems/Groups/EndOfFrameSystemGroup.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.10101software.dots.hybridsimulation",
"description": "A framework for using FixedUpdate in a simulation world which is linked to a GameObject-based presentation layer.",
"version": "0.7.5-preview.1",
"version": "0.7.5",
"unity": "2020.2",
"displayName": "DOTS Hybrid Simulation Worlds",
"dependencies": {
Expand Down

0 comments on commit 5a67cfc

Please sign in to comment.