Merge pull request #2689 from AoiKamishiro/customizableJobhandle

FastSpringBoneジョブのJobHandleをより柔軟に扱えるようにする変更
This commit is contained in:
ousttrue
2025-07-14 17:43:21 +09:00
committed by GitHub
2 changed files with 12 additions and 2 deletions

View File

@@ -18,9 +18,13 @@ namespace UniGLTF.SpringBoneJobs
_bufferCombiner.Dispose();
}
public JobHandle Schedule(float deltaTime)
public JobHandle Schedule(float deltaTime, JobHandle? dependency = null)
{
var handle = _bufferCombiner.ReconstructIfDirty(default);
if(dependency.HasValue)
{
handle = JobHandle.CombineDependencies(handle, dependency.Value);
}
if (!_bufferCombiner.HasBuffer)
{
return handle;

View File

@@ -1,4 +1,5 @@
using UniGLTF.SpringBoneJobs;
using Unity.Jobs;
using UnityEngine;
namespace UniVRM10.FastSpringBones
@@ -95,12 +96,17 @@ namespace UniVRM10.FastSpringBones
}
public void ManualUpdate(float deltaTime)
{
ManualUpdate(deltaTime, null).Complete();
}
public JobHandle ManualUpdate(in float deltaTime, in JobHandle? dependency = null)
{
if (UpdateType != UpdateTypes.Manual)
{
throw new global::System.ArgumentException("require UpdateTypes.Manual");
}
_fastSpringBoneScheduler.Schedule(deltaTime).Complete();
return _fastSpringBoneScheduler.Schedule(deltaTime, dependency);
}
public void OnDrawGizmosSelected()