Merge branch 'wl/ui/WL-814f-rig-teardown-order'

This commit is contained in:
깃 관리자 2026-09-12 17:18:47 +09:00
commit e519a52452
1 changed files with 11 additions and 0 deletions

View File

@ -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)
{