Skip to content

Commit

Permalink
Parallel Data can now access relatives
Browse files Browse the repository at this point in the history
  • Loading branch information
knowlife4 committed Jan 23, 2023
1 parent 045aabf commit 3f09ee7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ECT/Assets/Runtime/Parallel/ECTParallelJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace ECT.Parallel
{
public interface IParallelData<MyData> where MyData : unmanaged, IParallelData<MyData>
{
public MyData Execute();
public MyData Execute(NativeArray<MyData> DataArray);
}

public static class API
Expand Down Expand Up @@ -60,7 +60,7 @@ public struct ECTParallelJobBurst : IJobParallelFor

public void Execute(int index)
{
DataArray[index] = DataArray[index].Execute();
DataArray[index] = DataArray[index].Execute(DataArray);
}
}

Expand All @@ -70,7 +70,7 @@ public struct ECTParallelJob : IJobParallelFor

public void Execute(int index)
{
DataArray[index] = DataArray[index].Execute();
DataArray[index] = DataArray[index].Execute(DataArray);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public struct ParallelData : IParallelData<ParallelData>
public float Speed;
public float DeltaTime;

public ParallelData Execute()
public ParallelData Execute(NativeArray<ParallelData> DataArray)
{
float3 direction = Target.position - Transform.position;

Expand Down

0 comments on commit 3f09ee7

Please sign in to comment.