local 変数の使いまわしやめ

This commit is contained in:
ousttrue 2022-10-25 21:50:59 +09:00
parent a334a78f21
commit 11b6689c01

View File

@ -13,21 +13,29 @@ namespace UniVRM10.FastSpringBones.System
_bufferCombiner = bufferCombiner;
}
/// <summary>
/// SpringBone の依存関係のある Job を直列にスケジュールする
///
/// 1. ReconstructIfDirty
/// 2. PullTransformJob
/// 3. UpdateFastSpringBoneJob
/// 4. PushTransformJob
///
/// </summary>
public JobHandle Schedule()
{
var handle = default(JobHandle);
handle = _bufferCombiner.ReconstructIfDirty(handle);
var handle0 = _bufferCombiner.ReconstructIfDirty(default);
if (!_bufferCombiner.HasBuffer)
{
return handle;
return handle0;
}
handle = new PullTransformJob
{
Transforms = _bufferCombiner.Transforms
}.Schedule(_bufferCombiner.TransformAccessArray, handle);
handle = new UpdateFastSpringBoneJob
var handle1 = new PullTransformJob
{
Transforms = _bufferCombiner.Transforms
}.Schedule(_bufferCombiner.TransformAccessArray, handle0);
var handle2 = new UpdateFastSpringBoneJob
{
Colliders = _bufferCombiner.Colliders,
Joints = _bufferCombiner.Joints,
@ -35,14 +43,14 @@ namespace UniVRM10.FastSpringBones.System
Springs = _bufferCombiner.Springs,
Transforms = _bufferCombiner.Transforms,
DeltaTime = Time.deltaTime,
}.Schedule(_bufferCombiner.Springs.Length, 1, handle);
}.Schedule(_bufferCombiner.Springs.Length, 1, handle1);
handle = new PushTransformJob
{
Transforms = _bufferCombiner.Transforms
}.Schedule(_bufferCombiner.TransformAccessArray, handle);
var handle3 = new PushTransformJob
{
Transforms = _bufferCombiner.Transforms
}.Schedule(_bufferCombiner.TransformAccessArray, handle2);
return handle;
return handle3;
}
public void Dispose()