diff --git a/Packages/nadena.dev.modular-avatar/Editor/PluginDefinition/ModularAvatarContext.cs b/Packages/nadena.dev.modular-avatar/Editor/PluginDefinition/ModularAvatarContext.cs new file mode 100644 index 00000000..2cb5fd7f --- /dev/null +++ b/Packages/nadena.dev.modular-avatar/Editor/PluginDefinition/ModularAvatarContext.cs @@ -0,0 +1,28 @@ +using System; +using nadena.dev.build_framework; +using nadena.dev.modular_avatar.editor.ErrorReporting; + +namespace nadena.dev.modular_avatar.core.editor +{ + internal class ModularAvatarContext : IExtensionContext + { + private IDisposable toDispose; + internal BuildContext BuildContext { get; private set; } + + public void OnActivate(build_framework.BuildContext context) + { + if (BuildContext == null) + { + BuildContext = new BuildContext(context); + } + + toDispose = BuildReport.CurrentReport.ReportingOnAvatar(context.AvatarDescriptor); + } + + public void OnDeactivate(build_framework.BuildContext context) + { + toDispose?.Dispose(); + toDispose = null; + } + } +} \ No newline at end of file diff --git a/Packages/nadena.dev.modular-avatar/Editor/PluginDefinition/ModularAvatarContext.cs.meta b/Packages/nadena.dev.modular-avatar/Editor/PluginDefinition/ModularAvatarContext.cs.meta new file mode 100644 index 00000000..fbe30f5b --- /dev/null +++ b/Packages/nadena.dev.modular-avatar/Editor/PluginDefinition/ModularAvatarContext.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2be0ae3b99ac44c0a35522d7fd0c6f10 +timeCreated: 1692614275 \ No newline at end of file