Update README.md

This commit is contained in:
Mikhail 2024-04-11 01:20:09 +08:00 committed by GitHub
parent 44a877e8c0
commit 41b86ccf72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -46,7 +46,7 @@ The framework can also be added to the project as source code.
# Code Example
```csharp
class VelocitySystemDI : IEcsRunProcess
class VelocitySystemDI : IEcsRun
{
class Aspect : EcsAspectAuto
{
@ -60,9 +60,9 @@ class VelocitySystemDI : IEcsRunProcess
public void Run()
{
foreach (var e in _world.Where(out Aspect s))
foreach (var e in _world.Where(out Aspect a))
{
s.poses.Write(e).position += s.velocities.Read(e).value * _time.DeltaTime;
a.poses.Get(e).position += a.velocities.Read(e).value * _time.DeltaTime;
}
}
}
@ -71,7 +71,7 @@ class VelocitySystemDI : IEcsRunProcess
<summary>Same code but without AutoInjections</summary>
```csharp
class VelocitySystem : IEcsRunProcess, IEcsInject<EcsDefaultWorld>, IEcsInject<TimeService>
class VelocitySystem : IEcsRun, IEcsInject<EcsDefaultWorld>, IEcsInject<TimeService>
{
class Aspect : EcsAspect
{
@ -93,9 +93,9 @@ class VelocitySystem : IEcsRunProcess, IEcsInject<EcsDefaultWorld>, IEcsInject<T
public void Run()
{
foreach (var e in _world.Where(out Aspect s))
foreach (var e in _world.Where(out Aspect a))
{
s.poses.Write(e).position += s.velocities.Read(e).value * _time.DeltaTime;
a.poses.Get(e).position += a.velocities.Read(e).value * _time.DeltaTime;
}
}
}