Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpringBoneの初期化を前方に移動しことで、非play時のDontDestroyOnLoadが発生してしまった。回避 #2448

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace UniVRM10
public class Vrm10FastSpringboneRuntime : IVrm10SpringBoneRuntime
{
private Vrm10Instance m_instance;
private readonly FastSpringBones.FastSpringBoneService m_fastSpringBoneService = FastSpringBones.FastSpringBoneService.Instance;
private FastSpringBones.FastSpringBoneService m_fastSpringBoneService;
private FastSpringBoneBuffer m_fastSpringBoneBuffer;

public Vector3 ExternalForce
Expand All @@ -32,6 +32,7 @@ public bool IsSpringBoneEnabled

public async Task InitializeAsync(Vrm10Instance instance, IAwaitCaller awaitCaller)
{
m_fastSpringBoneService = FastSpringBones.FastSpringBoneService.Instance;
m_instance = instance;

// NOTE: FastSpringBoneService は UnitTest などでは動作しない
Expand Down
8 changes: 6 additions & 2 deletions Assets/VRM10/Runtime/IO/Vrm10Importer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,12 @@ protected override async Task OnLoadHierarchy(IAwaitCaller awaitCaller, Func<str
if (UniGLTF.Extensions.VRMC_springBone.GltfDeserializer.TryGet(Data.GLTF.extensions, out UniGLTF.Extensions.VRMC_springBone.VRMC_springBone springBone))
{
await LoadSpringBoneAsync(awaitCaller, controller, springBone);
// Vrm10Runtime で初期化していたが、 async にするためこちらに移動 v0.127
await m_springboneRuntime.InitializeAsync(controller, awaitCaller);
if (Application.isPlaying)
{
// EditorImport では呼ばない
// Vrm10Runtime で初期化していたが、 async にするためこちらに移動 v0.127
await m_springboneRuntime.InitializeAsync(controller, awaitCaller);
}
}
// constraint
await LoadConstraintAsync(awaitCaller, controller);
Expand Down
Loading