Fix : 최적화 패치 진행

This commit is contained in:
KINDNICK 2025-12-02 20:38:32 +09:00
parent 981af8cefc
commit 250426b2c6
6 changed files with 28 additions and 6 deletions

View File

@ -277,6 +277,9 @@ public class RenderStreamOutput : MonoBehaviour
private void OnDestroy() private void OnDestroy()
{ {
// m_ScriptablePass 정리 (내부 텍스처 참조 해제)
m_ScriptablePass = null;
if (ShaderCameraTexture != null) if (ShaderCameraTexture != null)
{ {
ShaderCameraTexture.Release(); ShaderCameraTexture.Release();

View File

@ -28,6 +28,7 @@ public class CameraControlSystem : MonoBehaviour
private CameraManager cameraManager; private CameraManager cameraManager;
private CinemachineCamera currentVirtualCamera; private CinemachineCamera currentVirtualCamera;
private CameraInfoUI cameraInfoUI; private CameraInfoUI cameraInfoUI;
private GameObject cameraInfoUIGameObject; // UI GameObject 참조 저장 (정리용)
// FOV 물리 시스템 변수들 // FOV 물리 시스템 변수들
private float fovVelocity = 0f; // 현재 FOV 변화 속도 private float fovVelocity = 0f; // 현재 FOV 변화 속도
@ -71,9 +72,9 @@ public class CameraControlSystem : MonoBehaviour
UpdateCurrentCamera(); UpdateCurrentCamera();
} }
// CameraInfoUI 생성 // CameraInfoUI 생성 (정리를 위해 참조 저장)
GameObject uiGO = new GameObject("CameraInfoUI"); cameraInfoUIGameObject = new GameObject("CameraInfoUI");
cameraInfoUI = uiGO.AddComponent<CameraInfoUI>(); cameraInfoUI = cameraInfoUIGameObject.AddComponent<CameraInfoUI>();
// Beautify 컴포넌트 찾기 // Beautify 컴포넌트 찾기
Debug.Log("[CameraControlSystem] Beautify 초기화 시작"); Debug.Log("[CameraControlSystem] Beautify 초기화 시작");
@ -106,6 +107,14 @@ public class CameraControlSystem : MonoBehaviour
{ {
cameraManager.OnCameraChanged -= OnCameraChanged; cameraManager.OnCameraChanged -= OnCameraChanged;
} }
// CameraInfoUI GameObject 정리
if (cameraInfoUIGameObject != null)
{
Destroy(cameraInfoUIGameObject);
cameraInfoUIGameObject = null;
cameraInfoUI = null;
}
} }
private void InitializeRawInput() private void InitializeRawInput()

View File

@ -242,6 +242,8 @@ public class CameraManager : MonoBehaviour, IController
RawInput.Start(); RawInput.Start();
RawInput.WorkInBackground = true; RawInput.WorkInBackground = true;
} }
// 중복 구독 방지를 위해 먼저 해제 후 구독
RawInput.OnKeyDown -= HandleRawKeyDown;
RawInput.OnKeyDown += HandleRawKeyDown; RawInput.OnKeyDown += HandleRawKeyDown;
} }

View File

@ -212,8 +212,11 @@ public class EventController : MonoBehaviour, IController
if (!RawInput.IsRunning) if (!RawInput.IsRunning)
{ {
RawInput.Start(); RawInput.Start();
RawInput.OnKeyDown += HandleRawKeyDown; RawInput.WorkInBackground = true;
} }
// 중복 구독 방지를 위해 먼저 해제 후 구독
RawInput.OnKeyDown -= HandleRawKeyDown;
RawInput.OnKeyDown += HandleRawKeyDown;
} }
private void UpdateHotkeyRecording() private void UpdateHotkeyRecording()

View File

@ -239,6 +239,8 @@ public class ItemController : MonoBehaviour, IController
RawInput.Start(); RawInput.Start();
RawInput.WorkInBackground = true; RawInput.WorkInBackground = true;
} }
// 중복 구독 방지를 위해 먼저 해제 후 구독
RawInput.OnKeyDown -= HandleRawKeyDown;
RawInput.OnKeyDown += HandleRawKeyDown; RawInput.OnKeyDown += HandleRawKeyDown;
} }
#endregion #endregion

View File

@ -339,9 +339,10 @@ public class SystemController : MonoBehaviour
byte[] bytes = screenshot.EncodeToPNG(); byte[] bytes = screenshot.EncodeToPNG();
File.WriteAllBytes(fullPath, bytes); File.WriteAllBytes(fullPath, bytes);
// 정리 // 정리 - RenderTexture는 Release() 후 Destroy() 호출 필요
screenshotCamera.targetTexture = currentRT; screenshotCamera.targetTexture = currentRT;
RenderTexture.active = null; RenderTexture.active = null;
rt.Release();
Destroy(rt); Destroy(rt);
Destroy(screenshot); Destroy(screenshot);
@ -420,10 +421,12 @@ public class SystemController : MonoBehaviour
byte[] bytes = screenshot.EncodeToPNG(); byte[] bytes = screenshot.EncodeToPNG();
File.WriteAllBytes(fullPath, bytes); File.WriteAllBytes(fullPath, bytes);
// 정리 // 정리 - RenderTexture는 Release() 후 Destroy() 호출 필요
screenshotCamera.targetTexture = currentRT; screenshotCamera.targetTexture = currentRT;
RenderTexture.active = null; RenderTexture.active = null;
rt.Release();
Destroy(rt); Destroy(rt);
alphaRT.Release();
Destroy(alphaRT); Destroy(alphaRT);
Destroy(screenshot); Destroy(screenshot);