mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 01:44:35 +08:00
Update README.md
This commit is contained in:
parent
68a3c18ba1
commit
7a67462560
12
README.md
12
README.md
@ -765,11 +765,11 @@ using (marker.Auto())
|
||||
</br>
|
||||
|
||||
# Framework Extension Tools
|
||||
Для большей расширяемости фреймворка есть дополнительные инструменты.
|
||||
There are additional tools for greater extensibility of the framework.
|
||||
|
||||
## Configs
|
||||
Конструкторы классов `EcsWorld` и `EcsPipeline` могут принимать контейнеры конфигов реализующие интерфейс `IConfigContainer` или `IConfigContainerWriter`. С помощью этих контейнеров можно передавать данные и зависимости. Встроенная реализация контейнера - `ConfigContainer`, но можно так же использовать свою реализацию.</br>
|
||||
Пример использования конфигов для мира:
|
||||
Constructors of `EcsWorld` and `EcsPipeline` classes can accept config containers implementing `IConfigContainer` or `IConfigContainerWriter` interface. These containers can be used to pass data and dependencies. The built-in container implementation is `ConfigContainer`, but you can also use your own implementation.</br>
|
||||
Example of using configs for EcsWorld:
|
||||
``` c#
|
||||
var configs = new ConfigContainer()
|
||||
.Set(new EcsWorldConfig(entitiesCapacity: 2000, poolsCapacity: 2000)
|
||||
@ -780,9 +780,9 @@ EcsDefaultWorld _world = new EcsDefaultWorld(configs);
|
||||
var _someDataA = _world.Configs.Get<SomeDataA>();
|
||||
var _someDataB = _world.Configs.Get<SomeDataB>();
|
||||
```
|
||||
Пример использования конфигов для пайплайна:
|
||||
Example of using configs for EcsPipeline:
|
||||
``` c#
|
||||
_pipeline = EcsPipeline.New()// аналогично _pipeline = EcsPipeline.New(new ConfigContainer())
|
||||
_pipeline = EcsPipeline.New()// similarly _pipeline = EcsPipeline.New(new ConfigContainer())
|
||||
.Configs.Set(new SomeDataA(/* ... */))
|
||||
.Configs.Set(new SomeDataB(/* ... */))
|
||||
// ...
|
||||
@ -857,7 +857,7 @@ public struct WorldComponent : IEcsWorldComponent<WorldComponent>
|
||||
```
|
||||
</details>
|
||||
|
||||
> Компоненты и конфиги можно применять для создания расширений в связке с методами расширений.
|
||||
> Components and configs can be used to create extensions in conjunction with extension methods.
|
||||
|
||||
</br>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user