Skip to content

Commit fdc114e

Browse files
author
Pixeye
committed
Update
1 parent e8befd8 commit fdc114e

File tree

3 files changed

+7
-20
lines changed

3 files changed

+7
-20
lines changed

Runtime/LibEcs/CacheEntity.cs

+1-18
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,6 @@ public void CleanMask(int id)
5757
Entity.GenerationsInstant[id, generation] &= ~mask;
5858
}
5959
}
60-
61-
// public void Remove(int type)
62-
// {
63-
// var typeConverted = (ushort) type;
64-
//
65-
// for (int i = componentsAmount - 1; i >= 0; i--)
66-
// {
67-
// if (componentsIds[i] == typeConverted)
68-
// {
69-
// for (int j = i; j < componentsAmount; ++j)
70-
// componentsIds[j] = componentsIds[j + 1];
71-
//
72-
// componentsAmount--;
73-
//
74-
// break;
75-
// }
76-
// }
77-
// }
60+
7861
}
7962
}

Runtime/LibEcs/Entity.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,13 @@ public static ref T Set<T>(in this ent entity)
220220
public static void Set<T>(in this ent entity, T component)
221221
{
222222
var id = entity.id;
223+
224+
if (id >= Storage<T>.components.Length)
225+
Array.Resize(ref Storage<T>.components, id << 1);
226+
223227
entities[id].Add(Storage<T>.componentId);
224228
GenerationsInstant[id, Storage<T>.Generation] |= Storage<T>.ComponentMask;
225-
229+
226230
ref var componentInStorage = ref Storage<T>.components[id];
227231
componentInStorage = component;
228232
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"displayName": "Actors",
55
"description": "ACTORS is a complete game framework with multiscene editing, game object pooling, ECS and data-driven approach for game logic explicitly built for Unity3d. It is used to ease the pain of decoupling data from behaviors without tons of boilerplate code and unnecessary overhead.",
66
"unity": "2019.3",
7-
"version": "2020.4.16",
7+
"version": "2020.4.30",
88
"keywords": [
99
"ecs",
1010
"pixeye",

0 commit comments

Comments
 (0)