You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
3.0.0-preview.31
# [3.0.0-preview.31](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.30...v3.0.0-preview.31) (2020-09-02) ### Bug Fixes * combine Instances error ([878f812](878f81202a)), closes [#91](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/91) * in rare cases, the particle size is incorrect with camera-space mode ([90593ac](90593ac021)), closes [#93](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/93) * trails material uses sprite texture ([9e65ee7](9e65ee7345)), closes [#92](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/92) ### Features * refresh children ParticleSystem with a gameObjects as root ([8bae1d0](8bae1d08cc))
This commit is contained in:
@@ -129,7 +129,7 @@ namespace Coffee.UIExtensions
|
||||
SetParticleSystemInstance(instance, true);
|
||||
}
|
||||
|
||||
public void SetParticleSystemInstance(GameObject instance, bool destroy)
|
||||
public void SetParticleSystemInstance(GameObject instance, bool destroyOldParticles)
|
||||
{
|
||||
if (!instance) return;
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace Coffee.UIExtensions
|
||||
{
|
||||
var go = child.gameObject;
|
||||
go.SetActive(false);
|
||||
if (!destroy) continue;
|
||||
if (!destroyOldParticles) continue;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying)
|
||||
@@ -151,7 +151,7 @@ namespace Coffee.UIExtensions
|
||||
tr.SetParent(transform, false);
|
||||
tr.localPosition = Vector3.zero;
|
||||
|
||||
RefreshParticles();
|
||||
RefreshParticles(instance);
|
||||
}
|
||||
|
||||
public void SetParticleSystemPrefab(GameObject prefab)
|
||||
@@ -163,7 +163,13 @@ namespace Coffee.UIExtensions
|
||||
|
||||
public void RefreshParticles()
|
||||
{
|
||||
GetComponentsInChildren(particles);
|
||||
RefreshParticles(gameObject);
|
||||
}
|
||||
|
||||
public void RefreshParticles(GameObject root)
|
||||
{
|
||||
if (!root) return;
|
||||
root.GetComponentsInChildren(particles);
|
||||
|
||||
foreach (var ps in particles)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user