You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 12:10:08 +00:00
fix: the camera under UIParticle will be assigned as _orthoCamera
Prevents unintended camera control
This commit is contained in:
@@ -582,7 +582,16 @@ namespace Coffee.UIExtensions
|
||||
// When render mode is ScreenSpaceOverlay, use ortho-camera.
|
||||
if (!_orthoCamera)
|
||||
{
|
||||
_orthoCamera = GetComponentInChildren<Camera>();
|
||||
// Find existing ortho-camera.
|
||||
foreach (Transform child in transform)
|
||||
{
|
||||
var cam = child.GetComponent<Camera>();
|
||||
if (cam && cam.name == "[generated] UIParticleOverlayCamera")
|
||||
{
|
||||
_orthoCamera = cam;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Create ortho-camera.
|
||||
if (!_orthoCamera)
|
||||
|
||||
Reference in New Issue
Block a user