mirror of
https://github.com/DCFApixels/DragonECS-AutoInjections.git
synced 2025-09-18 05:04:35 +08:00
update readme
This commit is contained in:
parent
bf4f6ff6e0
commit
abcf75560f
33
README-RU.md
33
README-RU.md
@ -11,8 +11,29 @@
|
|||||||
|
|
||||||
# Auto Injections for [DragonECS](https://github.com/DCFApixels/DragonECS)
|
# Auto Injections for [DragonECS](https://github.com/DCFApixels/DragonECS)
|
||||||
|
|
||||||
| Languages: | [Русский](https://github.com/DCFApixels/DragonECS-AutoInjections/blob/main/README-RU.md) | [English(WIP)](https://github.com/DCFApixels/DragonECS-AutoInjections) |
|
<table>
|
||||||
| :--- | :--- | :--- |
|
<tr></tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="3">Readme Languages:</td>
|
||||||
|
</tr>
|
||||||
|
<tr></tr>
|
||||||
|
<tr>
|
||||||
|
<td nowrap width="100">
|
||||||
|
<a href="https://github.com/DCFApixels/DragonECS-AutoInjections/blob/main/README-RU.md">
|
||||||
|
<img src="https://github.com/user-attachments/assets/3c699094-f8e6-471d-a7c1-6d2e9530e721"></br>
|
||||||
|
<span>Русский</span>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td nowrap width="100">
|
||||||
|
<a href="https://github.com/DCFApixels/DragonECS-AutoInjections">
|
||||||
|
<img src="https://github.com/user-attachments/assets/30528cb5-f38e-49f0-b23e-d001844ae930"></br>
|
||||||
|
<span>English(WIP)</span>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</br>
|
||||||
|
|
||||||
Расширение призвано сократить объем кода, упростив инъекцию зависимостей, делая их автоматически.
|
Расширение призвано сократить объем кода, упростив инъекцию зависимостей, делая их автоматически.
|
||||||
> **ВАЖНО!** Проект в стадии разработки. API может меняться.
|
> **ВАЖНО!** Проект в стадии разработки. API может меняться.
|
||||||
@ -37,7 +58,7 @@
|
|||||||
Опционально:
|
Опционально:
|
||||||
+ Игровые движки с C#: Unity, Godot, MonoGame и т.д.
|
+ Игровые движки с C#: Unity, Godot, MonoGame и т.д.
|
||||||
|
|
||||||
Протестированно:
|
Протестировано:
|
||||||
+ **Unity:** Минимальная версия 2020.1.0;
|
+ **Unity:** Минимальная версия 2020.1.0;
|
||||||
|
|
||||||
## Установка для Unity
|
## Установка для Unity
|
||||||
@ -46,7 +67,7 @@
|
|||||||
```
|
```
|
||||||
https://github.com/DCFApixels/DragonECS-AutoInjections.git
|
https://github.com/DCFApixels/DragonECS-AutoInjections.git
|
||||||
```
|
```
|
||||||
* ### В виде иходников
|
* ### В виде исходников
|
||||||
Фреймворк так же может быть добавлен в проект в виде исходников.
|
Фреймворк так же может быть добавлен в проект в виде исходников.
|
||||||
|
|
||||||
</br>
|
</br>
|
||||||
@ -121,7 +142,7 @@ sealed class DoSomethingProcessRunner : EcsRunner<IDoSomethingProcess>, IDoSomet
|
|||||||
}
|
}
|
||||||
|
|
||||||
//...
|
//...
|
||||||
// Если в пайплайн небыл добавлен раннер, то GetRunnerAuto автоматически добавит экземпляр DoSomethingProcessRunner.
|
// Если в пайплайн не был добавлен раннер, то GetRunnerAuto автоматически добавит экземпляр DoSomethingProcessRunner.
|
||||||
_pipeline.GetRunnerAuto<IDoSomethingProcess>().Do();
|
_pipeline.GetRunnerAuto<IDoSomethingProcess>().Do();
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -190,7 +211,7 @@ class VelocitySystem : IEcsRun, IEcsInject<EcsDefaultWorld>, IEcsInject<TimeServ
|
|||||||
|
|
||||||
# Не null инъекции
|
# Не null инъекции
|
||||||
|
|
||||||
Чтобы поле помеченное `[EcsInject]` было проинициализированно даже в случае отстувия инъекции, в конструктор атрибута можно передать тип болванку. В примере ниже поле `foo` получит экземпляр класса `Foo` из инъекции или экземпляр `FooDummy : Foo` если инъекции небыло.
|
Чтобы поле помеченное `[EcsInject]` было проинициализированно даже в случае отстувия инъекции, в конструктор атрибута можно передать тип болванку. В примере ниже поле `foo` получит экземпляр класса `Foo` из инъекции или экземпляр `FooDummy : Foo` если инъекции не было.
|
||||||
``` csharp
|
``` csharp
|
||||||
[EcsInject(typeof(FooDummy))] Foo foo;
|
[EcsInject(typeof(FooDummy))] Foo foo;
|
||||||
```
|
```
|
||||||
|
29
README.md
29
README.md
@ -11,8 +11,29 @@
|
|||||||
|
|
||||||
# Auto Injections for [DragonECS](https://github.com/DCFApixels/DragonECS)
|
# Auto Injections for [DragonECS](https://github.com/DCFApixels/DragonECS)
|
||||||
|
|
||||||
| Languages: | [Русский](https://github.com/DCFApixels/DragonECS-AutoInjections/blob/main/README-RU.md) | [English(WIP)](https://github.com/DCFApixels/DragonECS-AutoInjections) |
|
<table>
|
||||||
| :--- | :--- | :--- |
|
<tr></tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="3">Readme Languages:</td>
|
||||||
|
</tr>
|
||||||
|
<tr></tr>
|
||||||
|
<tr>
|
||||||
|
<td nowrap width="100">
|
||||||
|
<a href="https://github.com/DCFApixels/DragonECS-AutoInjections/blob/main/README-RU.md">
|
||||||
|
<img src="https://github.com/user-attachments/assets/7bc29394-46d6-44a3-bace-0a3bae65d755"></br>
|
||||||
|
<span>Русский</span>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td nowrap width="100">
|
||||||
|
<a href="https://github.com/DCFApixels/DragonECS-AutoInjections">
|
||||||
|
<img src="https://github.com/user-attachments/assets/3c699094-f8e6-471d-a7c1-6d2e9530e721"></br>
|
||||||
|
<span>English(WIP)</span>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</br>
|
||||||
|
|
||||||
The extension is designed to reduce the amount of code by simplifying dependency injection by doing injections automatically.
|
The extension is designed to reduce the amount of code by simplifying dependency injection by doing injections automatically.
|
||||||
> **NOTICE:** The project is a work in progress, API may change.
|
> **NOTICE:** The project is a work in progress, API may change.
|
||||||
@ -36,12 +57,12 @@ Tested with:
|
|||||||
|
|
||||||
## Unity Installation
|
## Unity Installation
|
||||||
* ### Unity Package
|
* ### Unity Package
|
||||||
The framework can be installed as a Unity package by adding the Git URL [in the PackageManager](https://docs.unity3d.com/2023.2/Documentation/Manual/upm-ui-giturl.html) or manually adding it to `Packages/manifest.json`:
|
The package can be installed as a Unity package by adding the Git URL [in the PackageManager](https://docs.unity3d.com/2023.2/Documentation/Manual/upm-ui-giturl.html) or manually adding it to `Packages/manifest.json`:
|
||||||
```
|
```
|
||||||
https://github.com/DCFApixels/DragonECS-AutoInjections.git
|
https://github.com/DCFApixels/DragonECS-AutoInjections.git
|
||||||
```
|
```
|
||||||
* ### Source Code
|
* ### Source Code
|
||||||
The framework can also be added to the project as source code.
|
The package can also be added to the project as source code.
|
||||||
|
|
||||||
</br>
|
</br>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user