Skip to content

Commit

Permalink
fix: apply on play not suppressed when av3emu is present (#200)
Browse files Browse the repository at this point in the history
Closes: #197
  • Loading branch information
bdunderscore committed Mar 16, 2024
1 parent 3d9f35d commit a2126f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

### Fixed
- Apply on play isn't suppressed when Av3mu is present (#200)
- JP fonts disappear after leaving play mode (#199)

### Changed
Expand Down
14 changes: 8 additions & 6 deletions Runtime/ApplyOnPlayGlobalActivator.cs
Expand Up @@ -20,15 +20,17 @@ internal static bool IsAv3EmuActive()
{
if (!ScriptableSingleton<NonPersistentConfig>.instance.applyOnPlay) return false;

foreach (var scene in Enumerable.Range(0, SceneManager.sceneCount).Select(SceneManager.GetSceneAt).Where(x => x.isLoaded))
foreach (var scene in Enumerable.Range(0, SceneManager.sceneCount).Select(SceneManager.GetSceneAt).Where(x => x.IsValid()))
foreach (var root in scene.GetRootGameObjects())
foreach (var emulator in root.GetComponentsInChildren<LyumaAv3Emulator>())
{
if (emulator.enabled && emulator.gameObject.activeInHierarchy)
foreach (var emulator in root.GetComponentsInChildren<LyumaAv3Emulator>())
{
// Force enable hook processing, same as VRCFury
emulator.RunPreprocessAvatarHook = true;
return true;
if (emulator.enabled && emulator.gameObject.activeInHierarchy)
{
// Force enable hook processing, same as VRCFury
emulator.RunPreprocessAvatarHook = true;
return true;
}
}
}

Expand Down
1 change: 0 additions & 1 deletion UnitTests~/PluginResolverTests/BeforeAfterPlugin.cs
Expand Up @@ -2,7 +2,6 @@
using System.Linq;
using nadena.dev.ndmf;
using NUnit.Framework;
using PlasticPipe.PlasticProtocol.Messages;

namespace UnitTests.PluginResolverTests
{
Expand Down

0 comments on commit a2126f5

Please sign in to comment.