Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created October 23, 2018 15:09
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/dc5adaaedc60f5e8a49fbf4f434d02b5 to your computer and use it in GitHub Desktop.
Save tsubaki/dc5adaaedc60f5e8a49fbf4f434d02b5 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([ReadOnly]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<SampleData1>
{
public void Execute([ReadOnly] ref SampleData1 data)
{
Debug.Log("sample8 p1");
}
}
struct Process2 : IJobProcessComponentData<SampleData2>
{
public void Execute([ReadOnly]ref SampleData2 data)
{
Debug.Log("sample8 p2");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment