Merge pull request #1494 from ousttrue/fix10/fix_dupl_firstperson

[1.0][FirstPerson]同じ対象に対する設定が複数ある場合に、先頭のものを採用する
This commit is contained in:
ousttrue
2022-02-02 21:12:55 +09:00
committed by GitHub

View File

@@ -155,8 +155,17 @@ namespace UniVRM10
var runtime = go.GetComponent<UniGLTF.RuntimeGltfInstance>();
var firstPersonBone = go.GetComponent<Animator>().GetBoneTransform(HumanBodyBones.Head);
var used = new HashSet<string>();
foreach (var x in Renderers)
{
if (!used.Add(x.Renderer))
{
// 同じ対象が複数回現れた
Debug.LogWarning($"VRM10ObjectFirstPerson.SetupAsync: duplicated {x.Renderer}");
continue;
}
if (isSelf)
{
await SetupSelfRendererAsync(go, runtime, firstPersonBone, x, layer, awaitCaller);