Skip to content

使用Cecil和unity的ILPostProcessor,在代码编译后修改代码

Notifications You must be signed in to change notification settings

whoisfpc/UnityILPostProcessorDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnityILPostProcessorDemo

使用Cecil和unity的ILPostProcessor,在代码编译后修改代码

说明

使用cecil修改已经编译好的代码,让打了[AutoInjectCall]属性的方法,在执行自己的逻辑前,自动额外执行 基类的AutoCalledHello方法。

  • 注意:因为Unity的限制,想要使用ILPostProcessor和相关机制,必须创建一个AssemblyDefine,并且命名格式为Unity.XXXX.CodeGen

参考

https://qiita.com/sune2/items/bb23de9364f966ada933
https://forum.unity.com/threads/how-does-unity-do-codegen-and-why-cant-i-do-it-myself.853867/#post-5646937

About

使用Cecil和unity的ILPostProcessor,在代码编译后修改代码

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages