private void CheckParticleList() { ParticleSystem[] pchild = AffectedObject.GetComponentsInChildren <ParticleSystem>(true); int newcount = pchild.Length; particleList = new List <ParticleSystem>(); List <ParticleSystem> rootlist = new List <ParticleSystem>(); if (pchild != null && pchild.Length > 0) { particleList.AddRange(pchild); } int len = particleList.Count; particleDict = new Dictionary <string, List <string> >(); for (int i = 0; i < len; i++) { if (ParticleSystemUtility.IsRoot(particleList[i])) { string key = particleList[i].transform.parent.name; if (particleDict.ContainsKey(key)) { particleDict[key].Add(particleList[i].name); } else { particleDict.Add(key, new List <string>() { particleList[i].name }); } rootlist.Add(particleList[i]); } } rootParticleList = rootlist; }