Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ECS ハイブリットその1
using UnityEngine;
using Unity.Entities;
public class JumpSystem : ComponentSystem
{
struct Group
{
public ComponentArray<Rigidbody2D> rigidbody2ds;
}
[Inject] Group group;
protected override void OnUpdate()
{
if (Input.GetMouseButtonDown(0))
group.rigidbody2ds[0].velocity = new Vector2(0, 3f);
}
}
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.