unity中的问题
报错
MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
报错翻译
MissingReferenceException:类型为“GameObject”的对象已被销毁,但您仍试图访问它。 您的脚本应该检查它是否为空,或者不应该销毁对象。
解决方法:1:在你引用按个对象之前先判断一下对象是否为空,不为空再引用
2:检查一下逻辑,可能在你用完之后某个地方销毁了,使用之前确认对象有赋值 确保不为空