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

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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删掉即可
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值