Change from Object.InstantiateAsync to GameObject.InstantiateGameObjects to utilize jobs.
This commit is contained in:
@@ -6,16 +6,19 @@ namespace Misaki.ArtTool
|
||||
{
|
||||
public struct TransformAccessJob : IJobParallelForTransform
|
||||
{
|
||||
public NativeArray<float4x4> points;
|
||||
[ReadOnly]
|
||||
public NativeList<float4x4> points;
|
||||
|
||||
public void Execute(int index, TransformAccess transform)
|
||||
{
|
||||
var currentPoint = points[index];
|
||||
|
||||
if (index > points.Length || !transform.isValid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MatrixHelper.DecomposeMatrix(points[index], out var position, out var rotation, out var scale);
|
||||
MatrixHelper.DecomposeMatrix(currentPoint, out var position, out var rotation, out var scale);
|
||||
|
||||
transform.SetPositionAndRotation(position, rotation);
|
||||
transform.localScale = scale;
|
||||
|
||||
Reference in New Issue
Block a user