Last active
March 18, 2019 11:33
-
-
Save tsubaki/ea58826f07605f26741f8631bd86b30e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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