- 🔒 Closed issue #5 in labbbirder/UnityInjection
- 🗣 Commented on #5 in labbbirder/UnityInjection
- 💪 Opened PR #5040 in openupm/openupm
- 💪 Opened PR #5039 in openupm/openupm
- 🗣 Commented on #1 in labbbirder/Unity-Shell
疯狂输出代码中_(:зゝ∠)_
Unity DLL注入,支持全平台,支持Mono和IL2CPP,支持注入引擎和用户DLL。可以实现AOP、装饰器等功能
License: MIT License
疯狂输出代码中_(:зゝ∠)_
不过,通过修改Mono.Cecil过滤掉这些dll可以解决
我就提一下~~~
AssemblyResolutionException: Failed to resolve assembly: 'Sirenix.OdinInspector.Attributes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.DefaultAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.MetadataResolver.Resolve (Mono.Cecil.TypeReference type) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.ModuleDefinition.Resolve (Mono.Cecil.TypeReference type) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.TypeReference.Resolve () (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.Mixin.CheckedResolve (Mono.Cecil.TypeReference self) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.SignatureReader.ReadCustomAttributeEnum (Mono.Cecil.TypeReference enum_type) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.SignatureReader.ReadCustomAttributeElementValue (Mono.Cecil.TypeReference type) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.SignatureReader.ReadCustomAttributeElement (Mono.Cecil.TypeReference type) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.SignatureReader.ReadCustomAttributeFixedArgument (Mono.Cecil.TypeReference type) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.SignatureReader.ReadCustomAttributeConstructorArguments (Mono.Cecil.CustomAttribute attribute, Mono.Collections.Generic.Collection`1[T] parameters) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.MetadataReader.ReadCustomAttributeSignature (Mono.Cecil.CustomAttribute attribute) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.CustomAttribute.<Resolve>b__35_0 (Mono.Cecil.CustomAttribute attribute, Mono.Cecil.MetadataReader reader) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.ModuleDefinition.Read[TItem] (TItem item, System.Action`2[T1,T2] read) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.CustomAttribute.Resolve () (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.CustomAttribute.get_ConstructorArguments () (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.ImmediateModuleReader.ReadCustomAttributes (Mono.Cecil.ICustomAttributeProvider provider) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.ImmediateModuleReader.ReadFields (Mono.Cecil.TypeDefinition type) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.ImmediateModuleReader.ReadType (Mono.Cecil.TypeDefinition type) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.ImmediateModuleReader.ReadTypes (Mono.Collections.Generic.Collection`1[T] types) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.ImmediateModuleReader.ReadModule (Mono.Cecil.ModuleDefinition module, System.Boolean resolve_attributes) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.ImmediateModuleReader.<ReadModule>b__2_0 (Mono.Cecil.ModuleDefinition module, Mono.Cecil.MetadataReader reader) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.ModuleDefinition.Read[TItem] (TItem item, System.Action`2[T1,T2] read) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.ImmediateModuleReader.ReadModule () (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.ModuleReader.CreateModule (Mono.Cecil.PE.Image image, Mono.Cecil.ReaderParameters parameters) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.ModuleDefinition.ReadModule (Mono.Disposable`1[T] stream, System.String fileName, Mono.Cecil.ReaderParameters parameters) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName, Mono.Cecil.ReaderParameters parameters) (at <ee112d265aad4e098cf6cf7bf2806b0e>:0)
com.bbbirder.injection.editor.InjectHelper.InjectAssembly (com.bbbirder.injection.InjectionInfo[] injections, System.String inputAssemblyPath, System.String outputAssemblyPath, System.Boolean isEditor, UnityEditor.BuildTarget buildTarget) (at Packages/[email protected]/Editor/InjectHelper.cs:46)
com.bbbirder.injection.editor.UnityInjectUtils.VisitAssembly (System.String assemblyPath, com.bbbirder.injection.InjectionInfo[] injections, System.Boolean isEditor, UnityEditor.BuildTarget buildTarget) (at Packages/[email protected]/Editor/UnityInjectUtils.cs:249)
com.bbbirder.injection.editor.UnityInjectUtils.InjectTargetMode (com.bbbirder.injection.InjectionInfo[] injections, System.Boolean isEditor, UnityEditor.BuildTarget buildTarget) (at Packages/[email protected]/Editor/UnityInjectUtils.cs:180)
com.bbbirder.injection.editor.UnityInjectUtils.InjectEditor (System.Reflection.Assembly[] assemblies) (at Packages/[email protected]/Editor/UnityInjectUtils.cs:151)
com.bbbirder.injection.editor.UnityInjectUtils.<Install>g__InjectEditorDelayed|1_3 () (at Packages/[email protected]/Editor/UnityInjectUtils.cs:119)
UnityEditor.EditorApplication.Internal_CallDelayFunctions () (at <308d48a21a3e462ba091bd758b25b1e6>:0)
$ openupm add com.bbbirder.injection
WARN 404 package [email protected] is not a valid choice of 1.0.4, 1.0.1, 1.0.0, 0.0.20, 0.0.18, 0.0.17, 0.0.16, 0.0.13, 0.0.12, 0.0.9, 0.0.8, 0.0.6
notice suggest to install [email protected] or a replaceable version manually
ERR! missing dependencies please resolve thie issue or run with option -f to ignore the warning
有可能是odin也有织入逻辑,占用了这个Assembly,建议增加一个手动忽略的名单
发现同时导入此工程和依赖工程的时候,sample无法正常运行。同时貌似缺少monoceil的库
示例:
函数A:public static void LoadSubAssets(string location, Action<Object[]> cb)
函数B:public static void LoadSubAssets(string location, Type type, Action<Object[]> cb)
函数C:public static void LoadSubAssets(string location, Action<TObject[]> cb) where TObject : Object
给函数B加上自定义装饰器实现了 DecoratorAttribute 的属性 并开始编译
会抛出异常 信息如下
Exception: Cannot find Method LoadSubAssets
in Type xxxx_class
报错库函数: InjectHelper.cs
FindMethod td.Methods.FirstOrDefault(m => m.GetSignature() == methodSignature) == null
Unity版本 2022.3.8f1
Can not inject in editor, Not sure why, maybe the API changed.
Unity2022 is tried, No problem.
在注入方法的时候需要一些额外字段的支持,该怎么操作?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.