Skip to content

Commit

Permalink
Merge branch 'master' into fix/vrm10_lookat_initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
ousttrue committed Sep 25, 2024
2 parents 4f8e98e + af06834 commit 4196b2d
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Assets/VRM10/Runtime/Components/Vrm10Instance/Vrm10Instance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,16 @@ internal Vrm10Runtime MakeRuntime(bool useControlRig)
{
if (m_springBoneRuntime == null)
{
// deafult に fallback
// TODO: scene に配置した prefab に SpringRuntime をカスタムする手段
m_springBoneRuntime = new Vrm10FastSpringboneRuntime();
var provider = GetComponent<IVrm10SpringBoneRuntimeProvider>();
if (provider != null)
{
m_springBoneRuntime = provider.CreateSpringBoneRuntime();
}
else
{
// deafult に fallback
m_springBoneRuntime = new Vrm10FastSpringboneRuntime();
}
m_springBoneRuntime.InitializeAsync(this, new ImmediateCaller());
}
return new Vrm10Runtime(this, useControlRig, m_springBoneRuntime);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using UnityEngine;

namespace UniVRM10
{
public class Vrm10FastSpringboneRuntimeProvider : MonoBehaviour, IVrm10SpringBoneRuntimeProvider
{
public IVrm10SpringBoneRuntime CreateSpringBoneRuntime()
{
return new Vrm10FastSpringboneRuntime();
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using UnityEngine;

namespace UniVRM10
{
public class Vrm10FastSpringboneRuntimeStandaloneProvider : MonoBehaviour, IVrm10SpringBoneRuntimeProvider
{
public IVrm10SpringBoneRuntime CreateSpringBoneRuntime()
{
return new Vrm10FastSpringboneRuntimeStandalone();
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Assets/VRM10/Runtime/IO/IVrm10SpringBoneRuntimeProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace UniVRM10
{
/// <summary>
/// This is an interface to customize springboneruntime of VRM-1.0 placed in the scene.
/// see Vrm10Instance.MakeRuntime.
/// </summary>
public interface IVrm10SpringBoneRuntimeProvider
{
IVrm10SpringBoneRuntime CreateSpringBoneRuntime();
}
}
11 changes: 11 additions & 0 deletions Assets/VRM10/Runtime/IO/IVrm10SpringBoneRuntimeProvider.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4196b2d

Please sign in to comment.