//------------------------------------------------------------------------- public void init() { mTransform = transform; mParticleSystem = GetComponent <ParticleSystem>(); mBaseParticle = gameObject.GetComponent <BaseParticle>(); if (mBaseParticle == null) { mBaseParticle = gameObject.AddComponent <NullParticle>(); } }
//------------------------------------------------------------------------- public void destroy() { if (mBaseParticle != null) { mBaseParticle.destroy(); mBaseParticle = null; } if (gameObject != null) { Destroy(gameObject); } }