Files
ShrinkNetwork.Integration.E…/CodeGen/Editor/NetworkEventILPostProcessor.cs
T
cneicy 2dae3e3890
Publish UPM package / publish (push) Successful in 2s
Publish NuGet packages / publish (push) Successful in 3m59s
fix(codegen): delegate event bridge weaving to shared processor
2026-09-29 10:14:48 +08:00

23 lines
909 B
C#

#nullable enable
using System.Collections.Generic;
using ShrinkShared.CodeGen;
using Unity.CompilationPipeline.Common.Diagnostics;
using Unity.CompilationPipeline.Common.ILPostProcessing;
namespace ShrinkNetwork.Integration.CodeGen
{
public sealed class NetworkEventILPostProcessor : ILPostProcessor
{
public override ILPostProcessor GetInstance() => this;
// ShrinkRegistryILPostProcessor owns the complete pass, including event bindings.
public override bool WillProcess(ICompiledAssembly compiledAssembly) => false;
public override ILPostProcessResult Process(ICompiledAssembly compiledAssembly) =>
WillProcess(compiledAssembly)
? UnityShrinkCodeGenAdapter.Process(compiledAssembly, "ShrinkNetwork.EventBus.CodeGen")
: new ILPostProcessResult(compiledAssembly.InMemoryAssembly, new List<DiagnosticMessage>());
}
}