mirror of
https://github.com/DCFApixels/DragonECS-AutoInjections.git
synced 2026-04-21 14:55:54 +08:00
update readme
This commit is contained in:
parent
541233c237
commit
8034709702
18
README-RU.md
18
README-RU.md
@ -121,16 +121,16 @@ EcsDefaultWorld _world;
|
||||
Так же AutoInjections упрощает построение аспектов. Для этого есть следующие атрибуты:
|
||||
|
||||
Атрибуты для инициализации полей с пулами:
|
||||
* `[Inc]` - кеширует пул и добавит тип компонента в включающее ограничение аспекта, аналог метода `Include`;
|
||||
* `[Exc]` - кеширует пул и добавит тип компонента в исключающее ограничение аспекта, аналог метода `Exclude`;
|
||||
* `[Opt]` - только кеширует пул, аналог метода `Optional`;
|
||||
* `[Inc]` - кеширует пул и добавит тип компонента в включающее ограничение аспекта, аналог метода `Inc<T>()`;
|
||||
* `[Exc]` - кеширует пул и добавит тип компонента в исключающее ограничение аспекта, аналог метода `Exc<T>()`;
|
||||
* `[Opt]` - только кеширует пул, аналог метода `Opt<T>()`;
|
||||
|
||||
Атрибут для комбинирования аспектов:
|
||||
* `[Combine(order)]` - кеширует аспект и скомбинирует ограничения аспектов, аналог метода `Combine`, аргумент `order` задает порядок комбинирования, по умлочанию `order = 0`;
|
||||
* `[Combine(order)]` - кеширует аспект и скомбинирует ограничения аспектов, аналог метода `Combine<TOtherAspect>(int)`, аргумент `order` задает порядок комбинирования, по умлочанию `order = 0`;
|
||||
|
||||
Дополнительные атрибуты только для задания ограничений аспекта. Их можно применить к самому аспекту, либо к любому полю внутри. Используйте атрибуты:
|
||||
* `[IncImplicit(type)]` - добавит в включающее ограничение указанный в конструкторе тип `type`, аналог метода `Include`;
|
||||
* `[ExcImplicit(type)]` - добавит в исключающее ограничение указанный в конструкторе тип `type`, аналог метода `Exclude`;
|
||||
* `[IncImplicit(type)]` - добавит в включающее ограничение указанный в конструкторе тип `type`, аналог метода `Inc<T>()`;
|
||||
* `[ExcImplicit(type)]` - добавит в исключающее ограничение указанный в конструкторе тип `type`, аналог метода `Exc<T>()`;
|
||||
|
||||
</br>
|
||||
|
||||
@ -198,9 +198,9 @@ class VelocitySystem : IEcsRun, IEcsInject<EcsDefaultWorld>, IEcsInject<TimeServ
|
||||
public EcsPool<Velocity> velocities;
|
||||
public Aspect(Builder b)
|
||||
{
|
||||
b.Exclude<FreezedTag>();
|
||||
poses = b.Include<Pose>();
|
||||
velocities = b.Include<Velocity>();
|
||||
b.Exc<FreezedTag>();
|
||||
poses = b.Ince<Pose>();
|
||||
velocities = b.Inc<Velocity>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
16
README.md
16
README.md
@ -122,16 +122,16 @@ EcsDefaultWorld _world;
|
||||
AutoInjections also simplifies building aspects. The following attributes are available:
|
||||
|
||||
Attributes for initializing pool fields:
|
||||
* `[Inc]` - caches the pool and adds the component type to the include constraint of the aspect (equivalent to `Include<T>()`);
|
||||
* `[Exc]` - caches the pool and adds the component type to the exclude constraint (equivalent to `Exclude<T>()`);
|
||||
* `[Opt]` - only caches the pool (equivalent to `Optional<T>`);
|
||||
* `[Inc]` - caches the pool and adds the component type to the include constraint of the aspect (equivalent to `Inc<T>()`);
|
||||
* `[Exc]` - caches the pool and adds the component type to the exclude constraint (equivalent to `Exc<T>()`);
|
||||
* `[Opt]` - only caches the pool (equivalent to `Opt<T>`);
|
||||
*
|
||||
Attribute for combining aspects:
|
||||
* `[Combine(order)]` - caches the aspect and merges constraints from aspects (equivalent to `Combine<TOtherAspect>(int)`); order sets combine order (default 0);
|
||||
|
||||
Additional attributes for specifying aspect constraints. They can be applied to the aspect itself or any field inside:
|
||||
* `[IncImplicit(type)]` - adds Type from the constructor to the include constraint (equivalent to `Include<T>()`);
|
||||
* `[ExcImplicit(type)]` - adds Type from the constructor to the exclude constraint (equivalent to `Exclude<T>()`);
|
||||
* `[IncImplicit(type)]` - adds Type from the constructor to the include constraint (equivalent to `Inc<T>()`);
|
||||
* `[ExcImplicit(type)]` - adds Type from the constructor to the exclude constraint (equivalent to `Exc<T>()`);
|
||||
|
||||
</br>
|
||||
|
||||
@ -200,9 +200,9 @@ class VelocitySystem : IEcsRun, IEcsInject<EcsDefaultWorld>, IEcsInject<TimeServ
|
||||
public EcsPool<Velocity> velocities;
|
||||
public Aspect(Builder b)
|
||||
{
|
||||
b.Exclude<FreezedTag>();
|
||||
poses = b.Include<Pose>();
|
||||
velocities = b.Include<Velocity>();
|
||||
b.Exc<FreezedTag>();
|
||||
poses = b.Inc<Pose>();
|
||||
velocities = b.Inc<Velocity>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user