void OnDisable() { for (int i = 0; i < mList.size;) { mPopEntryV2 ent = mList.buffer[i]; mList.RemoveAt(i); ent.OnClose(); } }
float time; //curTime from runing start void showPopValue() { time = Time.time; for (int i = 0; i < mList.size;) { mPopEntryV2 ent = mList.buffer[i]; ent.curRuningTime = time - ent.curStartTimePoint; if (ent.curRuningTime > ent.totalRuningTime) { PopEntrySceneTest2.value -= ent.list.size; mList.RemoveAt(i); ent.OnClose(); continue; } i++; } }
/// <summary> /// /// </summary> /// <param name="popTye"></param> /// <param name="curve_info"> 轨迹信息 </param> /// <param name="pos"> 初始生成位置 </param> void AddEntry(BetterList <mPopValue> value_list) { mPopEntryV2 newPopEntry = new mPopEntryV2(); ///设置运行数据 newPopEntry.curStartTimePoint = Time.time; newPopEntry.curRuningTime = 0f; newPopEntry.totalRuningTime = 3.0f; newPopEntry.list = value_list; ///返回当前pop类型对应的运动轨迹曲线 //string loadPath = "VertexFrame/" + PopEntryType.baoji.ToString(); //newPopEntry.pop_entry_meta = Resources.Load<mPopEntry_Meta_Info_2>(loadPath); newPopEntry.OnBeforeAdd(); PopEntrySceneTest2.value += value_list.size; mList.Add(newPopEntry); }