Merge branch 'main' into dev

This commit is contained in:
Mikhail 2024-06-13 19:06:21 +08:00
commit 576deef36d
4 changed files with 46 additions and 3 deletions

6
.gitignore vendored
View File

@ -26,6 +26,9 @@
# Visual Studio cache directory
.vs/
# Rider settings directory
.idea/
# Gradle cache directory
.gradle/
@ -70,3 +73,6 @@ crashlytics-build.properties
# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*
# Don't ignore main csproj file
!DragonECS.csproj

28
DragonECS.csproj Normal file
View File

@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>7.3</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<InvariantGlobalization>true</InvariantGlobalization>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RootNamespace>DCFApixels.DragonECS</RootNamespace>
<Title>DragonECS</Title>
<Version>0.8.36</Version>
<Authors>DCFApixels</Authors>
<Description>ECS Framework for Game Engines with C# and .Net Platform</Description>
<Copyright>DCFApixels</Copyright>
<RepositoryUrl>https://github.com/DCFApixels/DragonECS</RepositoryUrl>
<PackageLicenseUrl>https://github.com/DCFApixels/DragonECS/blob/main/LICENSE.meta</PackageLicenseUrl>
<PackageTags>ecs; gamedev; unity; dragonecs</PackageTags>
</PropertyGroup>
<ItemGroup>
<None Remove="**/*.meta" />
<None Remove="package.json" />
<None Remove="DragonECS.asmdef" />
</ItemGroup>
</Project>

7
DragonECS.csproj.meta Normal file
View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 804a6bf72b77a844495db239765f33ca
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -102,13 +102,15 @@ int newEntityID = _world.CloneEntity(entityID);
// Конвертация int в entlong.
entlong entity = _world.GetEntityLong(entityID);
// или
entlong entity = entityID.ToEntityLong(_world);
entlong entity = (_world, entityID);
// Проверка что сущность еще жива.
if (entity.IsAlive) { }
// Конвертация entlong в int. Если сущность уже не существует, будет брошено исключение.
int entityID = entity.ID;
// или
var (entityID, world) = entity;
// Конвертация entlong в int. Вернет true и ее int идентификатор, если сущность еще жива.
if (entity.TryGetID(out int entityID)) { }
@ -155,7 +157,7 @@ class SomeSystem : IEcsPreInit, IEcsInit, IEcsRun, IEcsDestroy
# Концепции фреймворка
## Пайплайн
Является контейнером и движком систем, определяя поочередность их вызова, предоставляющий механизм для сообщений между системами и механизм внедрения зависимостей. Реализован в виде класса `EcsPipeline`.
Контейнер и движок систем. Отвечает за настройку поочередности вызова систем, предоставляет механизм для сообщений между системами и механизм внедрения зависимостей. Реализован в виде класса `EcsPipeline`.
### Построение
За построение пайплайна отвечает Builder. В Builder добавляются системы, а в конце строится пайплайн. Пример:
```c#