在对 委托 事件 进行 操作 的时候, 事件 的 对象为空
NullReferenceException: Object reference not set to an instance of an object
unity delegate eventNullReferenceException: Object reference not set to an instance of an object
另外一个组件的调用 监听事件 的 Start 函数 ,改为 Awake 函数,就行了

本文介绍了在Unity中处理委托事件时遇到的NullReferenceException错误及其解决方案。通过将事件监听从Start函数改到Awake函数,可以有效避免空引用异常。
688

被折叠的 条评论
为什么被折叠?



