You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 12:10:08 +00:00
fix: SetParticleSystemInstance/Prefab APIs destroy generated objects
# Conflicts: # Packages/src/Runtime/UIParticle.cs
This commit is contained in:
@@ -404,9 +404,13 @@ namespace Coffee.UIExtensions
|
||||
{
|
||||
if (!instance) return;
|
||||
|
||||
foreach (Transform child in transform)
|
||||
var childCount = transform.childCount;
|
||||
for (var i = 0; i < childCount; i++)
|
||||
{
|
||||
var go = child.gameObject;
|
||||
var go = transform.GetChild(i).gameObject;
|
||||
if (go.TryGetComponent<Camera>(out var cam) && cam == _bakeCamera) continue;
|
||||
if (go.TryGetComponent<UIParticleRenderer>(out var _)) continue;
|
||||
|
||||
go.SetActive(false);
|
||||
if (destroyOldParticles)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user