mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
Add cleanup pass and exception reporting
This commit is contained in:
parent
a837008f3a
commit
30112030d4
@ -1,4 +1,6 @@
|
||||
using nadena.dev.ndmf;
|
||||
using System;
|
||||
using nadena.dev.modular_avatar.editor.ErrorReporting;
|
||||
using nadena.dev.ndmf;
|
||||
using nadena.dev.ndmf.animation;
|
||||
using nadena.dev.ndmf.fluent;
|
||||
using UnityEngine;
|
||||
@ -14,6 +16,11 @@ namespace nadena.dev.modular_avatar.core.editor.plugin
|
||||
public override string QualifiedName => "nadena.dev.modular-avatar";
|
||||
public override string DisplayName => "Modular Avatar";
|
||||
|
||||
protected override void OnUnhandledException(Exception e)
|
||||
{
|
||||
BuildReport.LogException(e);
|
||||
}
|
||||
|
||||
protected override void Configure()
|
||||
{
|
||||
Sequence seq = InPhase(BuildPhase.Resolving);
|
||||
@ -56,6 +63,13 @@ namespace nadena.dev.modular_avatar.core.editor.plugin
|
||||
animator.avatar = avatar;
|
||||
}
|
||||
});
|
||||
seq.Run("Purge ModularAvatar components", ctx =>
|
||||
{
|
||||
foreach (var component in ctx.AvatarRootTransform.GetComponentsInChildren<AvatarTagComponent>(true))
|
||||
{
|
||||
UnityEngine.Object.DestroyImmediate(component);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
InPhase(BuildPhase.Optimizing)
|
||||
|
Loading…
Reference in New Issue
Block a user