// Update is called once per frame public void Update() { for (int i = 0; i < animList.Count; i++) { //执行Update animList[i].executeUpdate(); if (animList[i].m_isDone == true) { AnimData animTmp = animList[i]; //执行回调 animTmp.ExecuteCallBack(); if (!animTmp.AnimReplayLogic()) { removeList.Add(animTmp); } } } for (int i = 0; i < removeList.Count; i++) { animList.Remove(removeList[i]); } removeList.Clear(); }
// Update is called once per frame public void Update() { for (int i = 0; i < animList.Count; i++) { //执行Update animList[i].executeUpdate(); if (animList[i].m_isDone == true) { AnimData animTmp = animList[i]; if (!animTmp.AnimReplayLogic()) { animList.Remove(animTmp); i--; //释放 //animTmp.Release(); HeapObjectPool <AnimData> .PutObject(animTmp); } //执行回调 animTmp.executeCallBack(); } } }
// Update is called once per frame void Update() { for (int i = 0; i < animList.Count; i++) { //执行Update animList[i].executeUpdate(); if (animList[i].m_isDone == true) { AnimData animTmp = animList[i]; if (!animTmp.AnimReplayLogic()) { animList.Remove(animTmp); i--; } //执行回调 animTmp.executeCallBack(); } } }