Instantly share code, notes, and snippets.

Embed
What would you like to do?
ジョブでログを出すだけ
using UnityEngine;
using Unity.Jobs;
using Unity.Entities;
using UnityEngine.Jobs;
public class LogJob : JobComponentSystem
{
private ComponentGroup _group;
protected override void OnCreateManager()
{
_group = GetComponentGroup(ComponentType.ReadOnly<Transform>());
}
protected override JobHandle OnUpdate(JobHandle inputDeps)
{
inputDeps = new Log().Schedule( _group.GetTransformAccessArray(), inputDeps);
return inputDeps;
}
struct Log : IJobParallelForTransform
{
public void Execute(int index, TransformAccess transform)
{
Debug.Log(transform.position);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment