Skip to content

Commit

Permalink
Merge branch 'main' into av-name-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunderscore authored Sep 24, 2023
2 parents f82fcdc + 4f7182a commit 3d1a374
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

* Fixed build failures when avatar names contained non-path-safe characters (#18)
- Fixed build failures when avatar names contained non-path-safe characters (#18)
- Suppress apply-on-play when Lyuma's Av3Emulator is active (improves compatibility) (#16)

### Changed

Expand Down
23 changes: 23 additions & 0 deletions Runtime/ApplyOnPlayGlobalActivator.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#if UNITY_EDITOR

using System;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
Expand Down Expand Up @@ -51,6 +52,28 @@ private void Awake()
if (!RuntimeUtil.IsPlaying || this == null) return;

var scene = gameObject.scene;

// Check if Lyuma's Av3Emulator is present and enabled; if so, we leave preprocessing up to it.
// First, find the type...

Type ty_av3emu = null;
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
ty_av3emu = assembly.GetType("Lyuma.Av3Emulator.Runtime.LyumaAv3Emulator", false);
if (ty_av3emu != null) break;
}

if (ty_av3emu != null)
{
foreach (var root in scene.GetRootGameObjects())
{
if (root.GetComponentInChildren(ty_av3emu) != null)
{
return;
}
}
}

foreach (var root in scene.GetRootGameObjects())
{
foreach (var avatar in root.GetComponentsInChildren<VRCAvatarDescriptor>())
Expand Down

0 comments on commit 3d1a374

Please sign in to comment.