Merge branch 'master' into asset-editing-blocks

This commit is contained in:
ousttrue
2026-02-19 16:34:02 +09:00
committed by GitHub
2 changed files with 12 additions and 3 deletions

View File

@@ -55,7 +55,10 @@ namespace UniHumanoid
/// HumanBone のマッピングを流用して、新たな Avatar を作り直す。
/// 古い Avatar は破棄する。
/// </summary>
public static void RebuildHumanAvatar(Animator animator)
/// <remarks>
/// This method runs asynchronously only in play mode.
/// </remarks>
public static async Awaitable RebuildHumanAvatar(Animator animator)
{
if (animator == null)
{
@@ -77,6 +80,9 @@ namespace UniHumanoid
if (Application.isPlaying)
{
GameObject.Destroy(animator);
// Else, the following AddComponent call will fail.
await Awaitable.NextFrameAsync();
}
else
{

View File

@@ -53,7 +53,10 @@ namespace VRM
/// <param name="go">対象モデルのルート</param>
/// <param name="forceTPose">強制的にT-Pose化するか</param>
/// <param name="useCurrentBlendShapeWeight">BlendShape の現状をbakeするか</param>
public static void Execute(GameObject go, bool forceTPose, bool useCurrentBlendShapeWeight)
/// <remarks>
/// This method runs asynchronously only in play mode.
/// </remarks>
public static async Awaitable Execute(GameObject go, bool forceTPose, bool useCurrentBlendShapeWeight)
{
if (forceTPose)
{
@@ -83,7 +86,7 @@ namespace VRM
// 回転とスケールが除去された新しいヒエラルキーからAvatarを作る
if (go.TryGetComponent<Animator>(out var animator))
{
HumanoidLoader.RebuildHumanAvatar(animator);
await HumanoidLoader.RebuildHumanAvatar(animator);
}
}