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

pull/318/head
mob-sakai 2024-06-26 19:17:05 +09:00
parent ae3f3a8e62
commit de35cba34c
1 changed files with 4 additions and 4 deletions

View File

@ -602,10 +602,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>();
@ -624,6 +621,9 @@ namespace Coffee.UIExtensions
_bakeCamera.renderingPath = RenderingPath.Forward;
_bakeCamera.useOcclusionCulling = false;
_bakeCamera.gameObject.SetActive(false);
_bakeCamera.gameObject.hideFlags = HideFlags.HideAndDontSave;
return _bakeCamera;
}
}