Skip to content

Commit

Permalink
Merge branch 'release/2023.3.22'
Browse files Browse the repository at this point in the history
  • Loading branch information
Leopotam committed Mar 22, 2023
2 parents 4622c76 + 0dfc673 commit 38759b9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* [ЧаВо](#ЧаВо)

# Социальные ресурсы
[![discord](https://img.shields.io/discord/404358247621853185.svg?label=enter%20to%20discord%20server&style=for-the-badge&logo=discord)](https://discord.gg/5GZVde6)
[![discord](https://img.shields.io/discord/404358247621853185.svg?label=enter%20to%20discord%20server&style=for-the-badge&logo=discord)](https://discord.gg/UQjdcbcHSf)

# Установка

Expand Down Expand Up @@ -299,10 +299,15 @@ class EcsStartup {
# Статьи

* ["Создание dungeon crawler'а с LeoECS Lite. Часть 1"](https://habr.com/ru/post/661085/)

[![](https://habrastorage.org/r/w1560/getpro/habr/upload_files/372/b1c/ad3/372b1cad308788dac56f8db1ea16b9c9.png)](https://habr.com/ru/post/661085/)

* ["Создание dungeon crawler'а с LeoECS Lite. Часть 2"](https://habr.com/ru/post/673926/)

[![](https://habrastorage.org/r/w1560/getpro/habr/upload_files/63f/3ef/c47/63f3efc473664fdaaf1a249f258e2486.png)](https://habr.com/ru/post/673926/)

* ["Всё что нужно знать про ECS"](https://habr.com/ru/post/665276/)

[![](https://habrastorage.org/r/w1560/getpro/habr/upload_files/3fd/5bc/544/3fd5bc5442b03a20d52a8003576056d4.png)](https://habr.com/ru/post/665276/)

# Проекты, использующие LeoECS Lite
Expand All @@ -322,6 +327,11 @@ class EcsStartup {

[![](https://github.com/7Bpencil/sharpPhysics/raw/master/pictures/preview.png)](https://github.com/7Bpencil/sharpPhysics)

## Без исходников

* [Microbiome (WIP)](https://vk.com/microbiomegame)

[![](https://img.youtube.com/vi/WTciasBN2eQ/0.jpg)](https://www.youtube.com/watch?v=WTciasBN2eQ)

# Расширения
* [Инъекция зависимостей](https://github.com/Leopotam/ecslite-di)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"displayName": "LeoECS Lite",
"description": "LeoECS Lite - легковесный ECS-фреймворк, основанный на структурах. Производительность, нулевые или минимальные аллокации, минимизация использования памяти, отсутствие зависимостей от любого игрового движка - это основные цели данного фреймворка.",
"unity": "2020.3",
"version": "2023.2.22",
"version": "2023.3.22",
"keywords": [
"leoecslite",
"leoecs",
Expand Down
23 changes: 11 additions & 12 deletions src/entities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ public static EcsPackedEntity PackEntity (this EcsWorld world, int entity) {

[MethodImpl (MethodImplOptions.AggressiveInlining)]
public static bool Unpack (this in EcsPackedEntity packed, EcsWorld world, out int entity) {
if (!world.IsAlive () || !world.IsEntityAliveInternal (packed.Id) || world.GetEntityGen (packed.Id) != packed.Gen) {
entity = -1;
return false;
}
entity = packed.Id;
return true;
return
world != null
&& world.IsAlive ()
&& world.IsEntityAliveInternal (packed.Id)
&& world.GetEntityGen (packed.Id) == packed.Gen;
}

[MethodImpl (MethodImplOptions.AggressiveInlining)]
Expand All @@ -98,19 +98,18 @@ public static EcsPackedEntityWithWorld PackEntityWithWorld (this EcsWorld world,

[MethodImpl (MethodImplOptions.AggressiveInlining)]
public static bool Unpack (this in EcsPackedEntityWithWorld packedEntity, out EcsWorld world, out int entity) {
if (packedEntity.World == null || !packedEntity.World.IsAlive () || !packedEntity.World.IsEntityAliveInternal (packedEntity.Id) || packedEntity.World.GetEntityGen (packedEntity.Id) != packedEntity.Gen) {
world = null;
entity = -1;
return false;
}
world = packedEntity.World;
entity = packedEntity.Id;
return true;
return
world != null
&& world.IsAlive ()
&& world.IsEntityAliveInternal (packedEntity.Id)
&& world.GetEntityGen (packedEntity.Id) == packedEntity.Gen;
}

[MethodImpl (MethodImplOptions.AggressiveInlining)]
public static bool EqualsTo (this in EcsPackedEntityWithWorld a, in EcsPackedEntityWithWorld b) {
return a.Id == b.Id && a.Gen == b.Gen && a.World == b.World;
}
}
}
}
2 changes: 1 addition & 1 deletion src/systems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class EcsSystems : IEcsSystems {
readonly List<IEcsPostRunSystem> _postRunSystems;
readonly object _shared;
#if DEBUG
bool _inited;
protected bool _inited;
#endif

public EcsSystems (EcsWorld defaultWorld, object shared = null) {
Expand Down

0 comments on commit 38759b9

Please sign in to comment.