diff --git a/src/Debug/Systems/SystemsDebugSystem.cs b/src/Debug/Systems/PipelineDebugSystem.cs similarity index 90% rename from src/Debug/Systems/SystemsDebugSystem.cs rename to src/Debug/Systems/PipelineDebugSystem.cs index d100ffb..4dc1bb4 100644 --- a/src/Debug/Systems/SystemsDebugSystem.cs +++ b/src/Debug/Systems/PipelineDebugSystem.cs @@ -5,29 +5,29 @@ using UnityEngine; namespace DCFApixels.DragonECS { [DebugHide, DebugColor(DebugColor.Gray)] - public class SystemsDebugSystem : IEcsPreInitSystem + public class PipelineDebugSystem : IEcsPreInitSystem { private string _name; - public SystemsDebugSystem(string name = "Systems") + public PipelineDebugSystem(string name = "Systems") { _name = name; } - void IEcsPreInitSystem.PreInit(EcsSystems systems) + void IEcsPreInitSystem.PreInit(EcsPipeline pipeline) { SystemsDebugMonitor monitor = new GameObject(EcsConsts.DEBUG_PREFIX + _name).AddComponent(); monitor.source = this; - monitor.systems = systems; - monitor.systemsName = _name; + monitor.pipeline = pipeline; + monitor.pipelineName = _name; Object.DontDestroyOnLoad(monitor.gameObject); } } public class SystemsDebugMonitor : MonoBehaviour { - internal SystemsDebugSystem source; - internal EcsSystems systems; - internal string systemsName; + internal PipelineDebugSystem source; + internal EcsPipeline pipeline; + internal string pipelineName; } #if UNITY_EDITOR @@ -38,7 +38,7 @@ namespace DCFApixels.DragonECS using UnityEditor; [CustomEditor(typeof(SystemsDebugMonitor))] - public class SystemsDebugMonitorEditor : Editor + public class PipelineDebugMonitorEditor : Editor { private DebugColorAttribute _fakeDebugColorAttribute = new DebugColorAttribute(DebugColor.White); private Type _debugColorAttributeType = typeof(DebugColorAttribute); @@ -67,7 +67,7 @@ namespace DCFApixels.DragonECS DebugMonitorPrefs.instance.IsShowHidden = EditorGUILayout.Toggle("Show Hidden", DebugMonitorPrefs.instance.IsShowHidden); GUILayout.BeginVertical(); - foreach (var item in Target.systems.AllSystems) + foreach (var item in Target.pipeline.AllSystems) { DrawSystem(item); } @@ -77,7 +77,7 @@ namespace DCFApixels.DragonECS GUILayout.Label("[Runners]", _headerStyle); GUILayout.BeginVertical(EcsEditor.GetStyle(Color.black)); - foreach (var item in Target.systems.AllRunners) + foreach (var item in Target.pipeline.AllRunners) { DrawRunner(item.Value); } diff --git a/src/Debug/Systems/SystemsDebugSystem.cs.meta b/src/Debug/Systems/PipelineDebugSystem.cs.meta similarity index 100% rename from src/Debug/Systems/SystemsDebugSystem.cs.meta rename to src/Debug/Systems/PipelineDebugSystem.cs.meta diff --git a/src/Debug/Systems/WorldDebugSystem.cs b/src/Debug/Systems/WorldDebugSystem.cs index 327a93f..cd7ea21 100644 --- a/src/Debug/Systems/WorldDebugSystem.cs +++ b/src/Debug/Systems/WorldDebugSystem.cs @@ -13,7 +13,7 @@ namespace DCFApixels.DragonECS _ecsWorld = ecsWorld; } - public void Run(EcsSystems systems) + public void Run(EcsPipeline pipeline) { } } diff --git a/src/Runner/IEcsFixedRunSystem.cs b/src/Runner/IEcsFixedRunSystem.cs index 7525a66..8d0bcc8 100644 --- a/src/Runner/IEcsFixedRunSystem.cs +++ b/src/Runner/IEcsFixedRunSystem.cs @@ -2,22 +2,22 @@ { public interface IEcsFixedRunSystem : IEcsSystem { - public void FixedRun(EcsSystems systems); + public void FixedRun(EcsPipeline pipeline); } public class EcsFixedRunSystemRunner : EcsRunner, IEcsFixedRunSystem { - void IEcsFixedRunSystem.FixedRun(EcsSystems systems) + void IEcsFixedRunSystem.FixedRun(EcsPipeline pipeline) { - foreach (var item in targets) item.FixedRun(systems); + foreach (var item in targets) item.FixedRun(pipeline); } } public static class IEcsFixedRunSystemExtensions { - public static void FixedRun(this EcsSystems systems) + public static void FixedRun(this EcsPipeline pipeline) { - systems.GetRunner().FixedRun(systems); + pipeline.GetRunner().FixedRun(pipeline); } } } diff --git a/src/Runner/IEcsLateRunSystem.cs b/src/Runner/IEcsLateRunSystem.cs index 582316d..bba7e52 100644 --- a/src/Runner/IEcsLateRunSystem.cs +++ b/src/Runner/IEcsLateRunSystem.cs @@ -2,12 +2,12 @@ { public interface IEcsLateRunSystem : IEcsSystem { - public void LateRun(EcsSystems systems); + public void LateRun(EcsPipeline systems); } public class EcsLateRunSystemRunner : EcsRunner, IEcsLateRunSystem { - void IEcsLateRunSystem.LateRun(EcsSystems systems) + void IEcsLateRunSystem.LateRun(EcsPipeline systems) { foreach (var item in targets) item.LateRun(systems); } @@ -15,7 +15,7 @@ public static class IEcsLateRunSystemExtensions { - public static void LateRun(this EcsSystems systems) + public static void LateRun(this EcsPipeline systems) { systems.GetRunner().LateRun(systems); } diff --git a/src/Templates/Startup.cs.txt b/src/Templates/Startup.cs.txt index 8edb9c7..78d23e8 100644 --- a/src/Templates/Startup.cs.txt +++ b/src/Templates/Startup.cs.txt @@ -6,7 +6,7 @@ namespace #NAMESPACE# sealed class #SCRIPTNAME# : MonoBehaviour { private EcsWorld _world; - private EcsSystems _systems; + private EcsPipeline _pipeline; private void Start() { @@ -14,7 +14,7 @@ namespace #NAMESPACE# UnityDebugService.Init(); _world = new EcsWorld(); - _systems = EcsSystems.New() + _pipeline = EcsPipeline.New() // register your systems here, for example: // .Add (new TestSystem1 ()) // .Add (new TestSystem2 ()) @@ -26,34 +26,34 @@ namespace #NAMESPACE# // with Inject you can also inject other data, for example: //.Inject(new SharedData()) #if UNITY_EDITOR - // add debug systems for this EcsSystems here - .Add(new SystemsDebugSystem()) + // add debug system for this EcsPipeline here + .Add(new PipelineDebugSystem()) #endif .BuildAndInit(); } private void Update() { - _systems?.Run(); + _pipeline?.Run(); } private void LateUpdate() { - _systems?.LateRun(); + _pipeline?.LateRun(); } private void FixedUpdate() { - _systems?.FixedRun(); + _pipeline?.FixedRun(); } private void OnDestroy() { // don't forget to clear data - if (_systems != null) + if (_pipeline != null) { - _systems.Destroy(); - _systems = null; + _pipeline.Destroy(); + _pipeline = null; } if (_world != null) diff --git a/src/Templates/System.cs.txt b/src/Templates/System.cs.txt index fa05e0d..c5c24f8 100644 --- a/src/Templates/System.cs.txt +++ b/src/Templates/System.cs.txt @@ -10,9 +10,9 @@ namespace #NAMESPACE# private EcsWorld _world; public void Inject(EcsWorld obj) => _world = obj; - public void Run(EcsSystems systems) + public void Run(EcsPipeline pipeline) { - // will be called on each EcsSystems.Run() call + // will be called on each EcsPipeline.Run() call } } } diff --git a/src/Templates/SystemExtended.cs.txt b/src/Templates/SystemExtended.cs.txt index a7a2eb7..25d2986 100644 --- a/src/Templates/SystemExtended.cs.txt +++ b/src/Templates/SystemExtended.cs.txt @@ -20,34 +20,34 @@ namespace #NAMESPACE# private EcsWorld _world; public void Inject(EcsWorld obj) => _world = obj; - public void PreInit(EcsSystems systems) + public void PreInit(EcsPipeline pipeline) { - // will be called once during EcsSystems.Init() call and before Init(EcsSystems systems). + // will be called once during EcsPipeline.Init() call and before Init(EcsPipeline pipeline). } - public void Init(EcsSystems systems) + public void Init(EcsPipeline pipeline) { - // will be called once during EcsSystems.Init() call and after PreInit(EcsSystems systems). + // will be called once during EcsPipeline.Init() call and after PreInit(EcsPipeline pipeline). } - public void Run(EcsSystems systems) + public void Run(EcsPipeline pipeline) { - // will be called on each EcsSystems.Run() call + // will be called on each EcsPipeline.Run() call } - public void LateRun(EcsSystems systems) + public void LateRun(EcsPipeline pipeline) { - // will be called on each EcsSystems.LateRun() call + // will be called on each EcsPipeline.LateRun() call } - public void FixedRun(EcsSystems systems) + public void FixedRun(EcsPipeline pipeline) { - // will be called on each EcsSystems.FixedRun() call + // will be called on each EcsPipeline.FixedRun() call } - public void Destroy(EcsSystems systems) + public void Destroy(EcsPipeline pipeline) { - // will be called once during EcsSystems.Destroy() call + // will be called once during EcsPipeline.Destroy() call } //Use Runners to implement additional messages