Skip to content

Instantly share code, notes, and snippets.

@tsubaki tsubaki/SampleSystem2.cs
Last active Mar 18, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.