diff --git a/CHANGELOG.md b/CHANGELOG.md index fb06fc4..1a47655 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Runtime/ApplyOnPlayGlobalActivator.cs b/Runtime/ApplyOnPlayGlobalActivator.cs index ce4480a..eed934f 100644 --- a/Runtime/ApplyOnPlayGlobalActivator.cs +++ b/Runtime/ApplyOnPlayGlobalActivator.cs @@ -20,15 +20,17 @@ internal static bool IsAv3EmuActive() { if (!ScriptableSingleton.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()) { - if (emulator.enabled && emulator.gameObject.activeInHierarchy) + foreach (var emulator in root.GetComponentsInChildren()) { - // 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; + } } } diff --git a/UnitTests~/PluginResolverTests/BeforeAfterPlugin.cs b/UnitTests~/PluginResolverTests/BeforeAfterPlugin.cs index 409fb3c..5935217 100644 --- a/UnitTests~/PluginResolverTests/BeforeAfterPlugin.cs +++ b/UnitTests~/PluginResolverTests/BeforeAfterPlugin.cs @@ -2,7 +2,6 @@ using System.Linq; using nadena.dev.ndmf; using NUnit.Framework; -using PlasticPipe.PlasticProtocol.Messages; namespace UnitTests.PluginResolverTests {