mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
chore: adjust PreventStripTagObjects to avoid stripping non-MA components as well
This commit is contained in:
parent
a7e4c11885
commit
05f2276aab
@ -1,10 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using VRC.SDKBase;
|
||||
using VRC.SDKBase.Editor.BuildPipeline;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace nadena.dev.modular_avatar.core.editor
|
||||
{
|
||||
@ -43,14 +45,19 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var editoronly in avatarGameObject.GetComponentsInChildren<IEditorOnly>(true))
|
||||
{
|
||||
if (editoronly == null || editoronly is AvatarTagComponent)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Object.DestroyImmediate((Component) editoronly);
|
||||
internal class ReplacementRemoveIEditorOnly : IVRCSDKPreprocessAvatarCallback
|
||||
{
|
||||
public int callbackOrder => Int32.MaxValue;
|
||||
|
||||
public bool OnPreprocessAvatar(GameObject avatarGameObject)
|
||||
{
|
||||
foreach (var component in avatarGameObject.GetComponentsInChildren<IEditorOnly>(true))
|
||||
{
|
||||
Object.DestroyImmediate(component as Object);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user