fix: generated baking-camera object remains in the prefab or scene (again)

mob-sakai 2024-06-26 19:17:05 +09:00
parent 4b30c16b9a
commit 5babd6d07b
1 changed files with 4 additions and 4 deletions

View File

@ -690,10 +690,7 @@ namespace Coffee.UIExtensions
// Create baking camera.
if (!_bakeCamera)
{
var go = new GameObject("[generated] UIParticle BakingCamera")
{
hideFlags = HideFlags.HideAndDontSave
};
var go = new GameObject("[generated] UIParticle BakingCamera");
go.SetActive(false);
go.transform.SetParent(transform, false);
_bakeCamera = go.AddComponent<Camera>();
@ -712,6 +709,9 @@ namespace Coffee.UIExtensions
_bakeCamera.renderingPath = RenderingPath.Forward;
_bakeCamera.useOcclusionCulling = false;
_bakeCamera.gameObject.SetActive(false);
_bakeCamera.gameObject.hideFlags = HideFlags.HideAndDontSave;
return _bakeCamera;
}
}