[WL-814f] 도트 모드 전환 시 MissingReferenceException: 해체 순서 수정(Critter 컴포넌트 먼저 정지 후 RT·머티리얼 파괴) (#814)
PD 실측: [카메라] 모드를 바꾸면 UpscaledCanvas.SetCanvasRenderTexture 에서 'Material has been destroyed' 예외가 매 프레임(콘솔 978건). 원인 = Object.Destroy 가 프레임 끝 처리라, 머티리얼 인스턴스를 지운 뒤에도 같은 프레임에 PixelCameraManager.LateUpdate 가 돌아 targetTexture==null 을 보고 RT 를 새로 만들고 이미 지운 머티리얼에 SetTexture 했다. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
2c82924a1f
commit
b18198c124
|
|
@ -412,6 +412,17 @@ namespace WL.PixelArt
|
||||||
{
|
{
|
||||||
bool had = s_rigRoot != null || s_proxyGo != null;
|
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)
|
if (s_src != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue