Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixeye committed Apr 30, 2020
1 parent e8befd8 commit fdc114e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
19 changes: 1 addition & 18 deletions Runtime/LibEcs/CacheEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,6 @@ public void CleanMask(int id)
Entity.GenerationsInstant[id, generation] &= ~mask;
}
}

// public void Remove(int type)
// {
// var typeConverted = (ushort) type;
//
// for (int i = componentsAmount - 1; i >= 0; i--)
// {
// if (componentsIds[i] == typeConverted)
// {
// for (int j = i; j < componentsAmount; ++j)
// componentsIds[j] = componentsIds[j + 1];
//
// componentsAmount--;
//
// break;
// }
// }
// }

}
}
6 changes: 5 additions & 1 deletion Runtime/LibEcs/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,13 @@ public static ref T Set<T>(in this ent entity)
public static void Set<T>(in this ent entity, T component)
{
var id = entity.id;

if (id >= Storage<T>.components.Length)
Array.Resize(ref Storage<T>.components, id << 1);

entities[id].Add(Storage<T>.componentId);
GenerationsInstant[id, Storage<T>.Generation] |= Storage<T>.ComponentMask;

ref var componentInStorage = ref Storage<T>.components[id];
componentInStorage = component;
}
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": "Actors",
"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.",
"unity": "2019.3",
"version": "2020.4.16",
"version": "2020.4.30",
"keywords": [
"ecs",
"pixeye",
Expand Down

0 comments on commit fdc114e

Please sign in to comment.