Skip to content

Commit

Permalink
Merge pull request #42 from noir-neo/enable-update-when-offscreen
Browse files Browse the repository at this point in the history
Enable UpdateWhenOffscreen
  • Loading branch information
noir-neo authored Feb 22, 2025
2 parents cc01bf8 + 393f9ef commit 005e26d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Assets/Hatbor/Scripts/Avatar/Avatar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Threading;
using Cysharp.Threading.Tasks;
using Hatbor.Rig;
using UniGLTF;
using UniVRM10;
using VContainer;
using VContainer.Unity;
Expand All @@ -26,6 +27,7 @@ public Avatar(string path, AvatarRig rig)
async UniTask IAsyncStartable.StartAsync(CancellationToken cancellation)
{
instance = await LoadAsync(path, cancellation);
Setup(instance.GetComponent<RuntimeGltfInstance>());
rig.Initialize(instance);
}

Expand All @@ -50,5 +52,10 @@ static async UniTask<Vrm10Instance> LoadAsync(string path, CancellationToken ctx
ct: ctx);
return instance;
}

static void Setup(RuntimeGltfInstance instance)
{
instance.EnableUpdateWhenOffscreen();
}
}
}

0 comments on commit 005e26d

Please sign in to comment.