Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Last active March 18, 2019 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/ea58826f07605f26741f8631bd86b30e to your computer and use it in GitHub Desktop.
Save tsubaki/ea58826f07605f26741f8631bd86b30e to your computer and use it in GitHub Desktop.
using Unity.Entities;
using Unity.Transforms;
public class SampleSystem2 : ComponentSystem
{
ComponentGroup _group;
protected override void OnCreateManager()
{
_group = GetComponentGroup(
ComponentType.Create<Position>(),
ComponentType.Create<Box>(),
ComponentType.Create<Score>());
}
protected override void OnUpdate()
{
Entities.With(_group).ForEach((ref Position pos, ref Box box) => {
// do somethings
}); // Groupを登録
Entities.With(_group).ForEach((ref Position pos, ref Score score) => {
// do somethings
}); // Groupを登録
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment