//管理生命周期 void CheckEffect() { //编辑器中误操作,移除所有为null的引用 for (int i = livetimelist.Count - 1; i >= 0; i--) { livetimelist[i].lifetime--; //生命周期每帧 -1 if (livetimelist[i].lifetime <= 0) //生命周期结束 删除特效 { iextplayer.CloseEffectLooped(livetimelist[i].effid); livetimelist.RemoveAt(i); } } //Resources.UnloadUnusedAssets(); //GC.Collect(); }