Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created October 23, 2018 15:04
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/f49ed20787f50298c0a70eb80ce59d94 to your computer and use it in GitHub Desktop.
Save tsubaki/f49ed20787f50298c0a70eb80ce59d94 to your computer and use it in GitHub Desktop.
using UnityEngine;
using Unity.Entities;
using Unity.Jobs;
using Unity.Collections;
public class TestSystem7 : JobComponentSystem
{
protected override JobHandle OnUpdate(JobHandle inputDeps)
{
var handle1 = new Process1().ScheduleSingle(this, inputDeps);
var handle2 = new Process2().ScheduleSingle(this, inputDeps);
return JobHandle.CombineDependencies(handle1, handle2);
}
struct Process1 : IJobProcessComponentData<SampleData1>
{
public void Execute(ref SampleData1 data)
{
Debug.Log("sample7 p1");
}
}
struct Process2 : IJobProcessComponentData<SampleData2>
{
public void Execute(ref SampleData2 data)
{
Debug.Log("sample7 p2");
}
}
}
using UnityEngine;
using Unity.Entities;
using Unity.Jobs;
using Unity.Collections;
public class TestSystem8 : JobComponentSystem
{
protected override JobHandle OnUpdate(JobHandle inputDeps)
{
var handle1 = new Process1().ScheduleSingle(this, inputDeps);
var handle2 = new Process2().ScheduleSingle(this, inputDeps);
return JobHandle.CombineDependencies(handle1, handle2);
}
struct Process1 : IJobProcessComponentData<SampleData3>
{
public void Execute(ref SampleData3 data)
{
Debug.Log("sample8 p1");
}
}
struct Process2 : IJobProcessComponentData<SampleData4>
{
public void Execute(ref SampleData4 data)
{
Debug.Log("sample8 p2");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment