Unity问题记录(二)自定义EditorWindow,当资源发生变化时,报Operation is not valid due to the current state of the object

本文探讨了在Unity中自定义EditorWindow时遇到的问题,当资源发生变化时报InvalidOperationException。深入分析了错误产生的原因,并提供了有效的解决方案,即删除引起错误的代码行及其对应的Begin部分。

Unity问题记录(二)自定义EditorWindow,当资源发生变化时,报Operation is not valid due to the current state of the object

1.问题

自定义EditorWindow,当资源发生变化时,报InvalidOperationException: Operation is not valid due to the current state of the object

2.原因

好像是你那段代码其实不需要,读取到的时候发现里面没有逻辑需要走

3.解决方案

将报错的哪行和与之对应的Begain删掉即可
在这里插入图片描述

unity APIUpdater encountered some issues and was not able to finish. Unhandled Exception: System.InvalidOperationException: Operation is not valid due to the current state of the object. at Mono.Cecil.ModuleDefinition.ReadSymbols (Mono.Cecil.Cil.ISymbolReader reader) [0x0002f] in <a3989f8c34e6476eaca56644d5639ee8>:0 at Mono.Cecil.ModuleReader.ReadSymbols (Mono.Cecil.ModuleDefinition module, Mono.Cecil.ReaderParameters parameters) [0x0004a] in <a3989f8c34e6476eaca56644d5639ee8>:0 at Mono.Cecil.ModuleReader.CreateModule (Mono.Cecil.PE.Image image, Mono.Cecil.ReaderParameters parameters) [0x00081] in <a3989f8c34e6476eaca56644d5639ee8>:0 at Mono.Cecil.ModuleDefinition.ReadModule (Mono.Disposable`1[T] stream, System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x0000d] in <a3989f8c34e6476eaca56644d5639ee8>:0 at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x0006c] in <a3989f8c34e6476eaca56644d5639ee8>:0 at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <a3989f8c34e6476eaca56644d5639ee8>:0 at APIUpdater.Framework.Configuration.ObsoleteAttributeBasedConfigurationFactory..ctor (System.String pathToAssemblyWithAttr, System.Boolean reportSourceInformation, System.String[] potentiallyReferencedAssemblyPaths) [0x00079] in <658ad496184746efb4798c63cf56a4bf>:0 at APIUpdater.Framework.Util.IEnumerableExtensions.ComputeConfigurationProvider (System.Collections.Generic.IEnumerable`1[T] assemblyPaths, APIUpdater.Framework.Configuration.ConfigurationProvider provider, System.String[] references) [0x00032] in <658ad496184746efb4798c63cf56a4bf>:0 at ScriptUpdater.Program.ConfigurationProviderFor (APIUpdater.Framework.Configuration.CompilerResponseFile responseFile, System.Text.RegularExpressions.Regex configSourceFilter, APIUpdater.Framework.Log.ConsoleUpdateListener logger) [0x000c8]
04-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值