From b18198c124045cc5de7f7ce4f40ea2d37c7a7e8e Mon Sep 17 00:00:00 2001 From: swrring Date: Sat, 12 Sep 2026 17:18:29 +0900 Subject: [PATCH] =?UTF-8?q?[WL-814f]=20=EB=8F=84=ED=8A=B8=20=EB=AA=A8?= =?UTF-8?q?=EB=93=9C=20=EC=A0=84=ED=99=98=20=EC=8B=9C=20MissingReferenceEx?= =?UTF-8?q?ception:=20=ED=95=B4=EC=B2=B4=20=EC=88=9C=EC=84=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95(Critter=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20?= =?UTF-8?q?=EB=A8=BC=EC=A0=80=20=EC=A0=95=EC=A7=80=20=ED=9B=84=20RT=C2=B7?= =?UTF-8?q?=EB=A8=B8=ED=8B=B0=EB=A6=AC=EC=96=BC=20=ED=8C=8C=EA=B4=B4)=20(#?= =?UTF-8?q?814)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PD 실측: [카메라] 모드를 바꾸면 UpscaledCanvas.SetCanvasRenderTexture 에서 'Material has been destroyed' 예외가 매 프레임(콘솔 978건). 원인 = Object.Destroy 가 프레임 끝 처리라, 머티리얼 인스턴스를 지운 뒤에도 같은 프레임에 PixelCameraManager.LateUpdate 가 돌아 targetTexture==null 을 보고 RT 를 새로 만들고 이미 지운 머티리얼에 SetTexture 했다. Co-Authored-By: Claude Opus 5 --- Assets/WL/PixelCamera/PixelCameraRig.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Assets/WL/PixelCamera/PixelCameraRig.cs b/Assets/WL/PixelCamera/PixelCameraRig.cs index 73b79a49d..12d42b3af 100644 --- a/Assets/WL/PixelCamera/PixelCameraRig.cs +++ b/Assets/WL/PixelCamera/PixelCameraRig.cs @@ -412,6 +412,17 @@ namespace WL.PixelArt { bool had = s_rigRoot != null || s_proxyGo != null; + // 🔴 WL-814f — 무엇을 지우기 전에 Critter 컴포넌트를 **먼저 멈춘다**. + // `Object.Destroy` 는 프레임 끝에 처리되므로, 아래에서 RT·머티리얼 인스턴스를 + // 지워도 같은 프레임에 `PixelCameraManager.LateUpdate` 가 한 번 더 돈다. + // 그러면 `targetTexture == null` 을 보고 RT 를 새로 만들어 + // `UpscaledCanvas.SetCanvasRenderTexture` → 이미 지운 머티리얼에 `SetTexture` → + // **MissingReferenceException** 이 매 프레임 터진다(모드 전환 때 실측). + if (s_mgr != null) s_mgr.enabled = false; + if (s_canvas != null) s_canvas.enabled = false; + if (s_gameCam != null) s_gameCam.enabled = false; + if (s_viewCam != null) s_viewCam.enabled = false; + // 원본 카메라 복원 — 스택에서 뷰 카메라부터 뺀다. if (s_src != null) {