mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-01 20:25:07 +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.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using VRC.SDKBase;
|
using VRC.SDKBase;
|
||||||
using VRC.SDKBase.Editor.BuildPipeline;
|
using VRC.SDKBase.Editor.BuildPipeline;
|
||||||
|
using Object = UnityEngine.Object;
|
||||||
|
|
||||||
namespace nadena.dev.modular_avatar.core.editor
|
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))
|
return true;
|
||||||
{
|
}
|
||||||
if (editoronly == null || editoronly is AvatarTagComponent)
|
}
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user