public void AddEffect(bool showEffect, uint effectId = 52018) { if (Particle != null) { Particle.gameObject.SetActive(showEffect); if (showEffect) { p = Particle.GetComponent <UIFrameAnimation>(); if (p == null) { p = Particle.gameObject.AddComponent <UIFrameAnimation>(); p.depth = 100; } if (p != null) { p.SetDimensions(1, 1); p.ReleaseParticle(); p.AddFrameParticle(effectId); } } else { if (p != null) { p.ReleaseParticle(); } } } }
void AddParticle(uint effectid) { if (m_trans_Particle != null) { bool showEffect = effectid != 0; m_trans_Particle.gameObject.SetActive(showEffect); particle = m_trans_Particle.GetComponent <UIFrameAnimation>(); if (showEffect) { if (particle == null) { particle = m_trans_Particle.gameObject.AddComponent <UIFrameAnimation>(); particle.depth = 100; } if (particle != null) { particle.SetDimensions(1, 1); particle.ReleaseParticle(); particle.AddFrameParticle(effectid); } } else { if (particle != null) { particle.ReleaseParticle(); } } } }