Created
October 23, 2018 15:09
-
-
Save tsubaki/dc5adaaedc60f5e8a49fbf4f434d02b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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