mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-14 22:50:08 -05:00
This change adds (pseudo) method RuntimeOnlyAwaitCaller.NextFrameIfTimedOut()
which invokes NextFrame() if given time is elapsed. Otherwise, it does nothing.
We'll be able to utilize this (pseudo) method to ease possible cause of spikes.
For example:
----
public class VRMImporterContext : ImporterContext {
protected override async Task OnLoadHierarchy(IAwaitCaller awaitCaller, ...) {
...
var blendShapeList = VRM.blendShapeMaster.blendShapeGroups;
if (blendShapeList != null && blendShapeList.Count > 0) {
foreach (var x in blendShapeList) {
await awaitCaller.NextFrameIfTimeout();
BlendShapeAvatar.Clips.Add(await LoadBlendShapeBind(awaitCaller, x, transformMeshTable));
}
}
...
}
}
----
Note that this change doesn't add NextFrameIfTimeout() to IAwaitCaller to avoid
breaking change. This limitation introduces extra (maybe unnecessarily) complexity.
|
||
|---|---|---|
| .. | ||
| UniGLTF | ||
| VRM | ||
| VRM_Samples | ||
| VRM10 | ||
| VRM10_Samples | ||
| VRMShaders | ||
| UniGLTF.meta | ||
| VRM_Samples.meta | ||
| VRM.meta | ||
| VRM10_Samples.meta | ||
| VRM10.meta | ||
| VRMShaders.meta | ||