XCharts-Team/XCharts

运行时删除BarChart后报错

monitor1394 opened this issue · 0 comments

Discussed in https://github.com/orgs/XCharts-Team/discussions/268

Originally posted by wmqKevin August 1, 2023
当我在运行时删除BarChart后报错如下:
MissingReferenceException: The object of type 'CanvasRenderer' 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.
at (wrapper managed-to-native) UnityEngine.CanvasRenderer.get_cull(UnityEngine.CanvasRenderer)
at UnityEngine.UI.GraphicRaycaster.Raycast (UnityEngine.Canvas canvas, UnityEngine.Camera eventCamera, UnityEngine.Vector2 pointerPosition, System.Collections.Generic.IList1[T] foundGraphics, System.Collections.Generic.List1[T] results) [0x00018] in G:\MZLU3D\Doctor-U_HDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\GraphicRaycaster.cs:335
at UnityEngine.UI.GraphicRaycaster.Raycast (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List1[T] resultAppendList) [0x00329] in G:\MZLU3D\Doctor-U_HDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\GraphicRaycaster.cs:236 at UnityEngine.EventSystems.EventSystem.RaycastAll (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List1[T] raycastResults) [0x0003f] in G:\MZLU3D\Doctor-U_HDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\EventSystem.cs:263
at UnityEngine.EventSystems.PointerInputModule.GetMousePointerEventData (System.Int32 id) [0x000a3] in G:\MZLU3D\Doctor-U_HDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\InputModules\PointerInputModule.cs:295
at UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent (System.Int32 id) [0x00001] in G:\MZLU3D\Doctor-U_HDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:540
at UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent () [0x00001] in G:\MZLU3D\Doctor-U_HDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:526
at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x0003e] in G:\MZLU3D\Doctor-U_HDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:280
at UnityEngine.EventSystems.EventSystem.Update () [0x000f6] in G:\MZLU3D\Doctor-U_HDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\EventSystem.cs:501