在做game场景的时候,pig.cs里面的Dead函数中,既然已经有了gameControl._instance.piglist.Remove(this)让死亡的猪从组件中移除了,后面Destroy(...
在做game场景的时候,pig.cs里面的Dead函数中,既然已经有了gameControl._instance.piglist.Remove(this)让死亡的猪从组件中移除了,后面Destroy(gameObject)也销毁了猪,那么下面那句 Instantiate(boom, transform.position, Quaternion.identity)中的transform.position从哪里获取已被销毁的猪的坐标值呢?我的unity就一直报错,说“The object of type 'GameObject' has been destroyed but you are still trying to access it.”但是代码跟老师的基本一样,为什么老师的没有报错呢?