public void lateUpdate() { if (mInited) { mVertexPool.LateUpdate(); } }
void LateUpdate() { if (!mInited) { return; } mVertexPool.LateUpdate(); }
void LateUpdate() { //make sure each mesh position is always zero. for (int i = 0; i < MeshList.Count; i++) { GameObject obj = MeshList[i]; if (obj != null) { obj.transform.position = Vector3.zero; obj.transform.rotation = Quaternion.identity; } } for (int i = 0; i < MatList.Count; i++) { VertexPool vp = MatList[i]; vp.LateUpdate(); } if (ElapsedTime > LifeTime && LifeTime >= 0) { DoFinish(); } else if (LifeTime < 0 && EflList.Count > 0) { //Xffect LifeTime < 0, 且又是EmitByRate的话,会自动判断是否已经没有活动节点,没有则自动Deactive()。 float deltaTime = (float)(CurTime - LastTime); bool allEfLFinished = true; for (int i = 0; i < EflList.Count; i++) { EffectLayer el = EflList[i]; if (!el.EmitOver(deltaTime)) { allEfLFinished = false; } } if (allEfLFinished) { DoFinish(); } } }
void UpdateMeshObj() { //make sure each mesh position is always zero. for (int i = 0; i < MeshList.Count; i++) { GameObject obj = MeshList[i]; if (obj != null) { obj.transform.position = Vector3.zero; obj.transform.rotation = Quaternion.identity; } } if (MergeSameMaterialMesh) { //ElementAt() STILL CAUSE GC ALLOC!! SO WE CAN'T AVOID GC ALLOC IN DICTIONARY? //for (int i = 0; i < MatDic.Count; i++) //{ // KeyValuePair<string,VertexPool> pair = MatDic.ElementAt(i); // pair.Value.LateUpdate(); //} //foreach (KeyValuePair<string, VertexPool> pair in MatDic) //{ // pair.Value.LateUpdate(); //} //Thanks to Ali Abdul-Karim's solution, no gc alloced now. var enumerator = MatDic.GetEnumerator(); while (enumerator.MoveNext()) { var element = enumerator.Current; // loop body goes here element.Value.LateUpdate(); } } else { for (int i = 0; i < MatList.Count; i++) { VertexPool vp = MatList[i]; vp.LateUpdate(); } } }
void UpdateMeshObj() { //make sure each mesh position is always zero. for (int i = 0; i < MeshList.Count; i++) { GameObject obj = MeshList[i]; if (obj != null) { obj.transform.position = Vector3.zero; obj.transform.rotation = Quaternion.identity; } } if (MergeSameMaterialMesh) { //ElementAt() STILL CAUSE GC ALLOC!! SO WE CAN'T AVOID GC ALLOC IN DICTIONARY? //for (int i = 0; i < MatDic.Count; i++) //{ // KeyValuePair<string,VertexPool> pair = MatDic.ElementAt(i); // pair.Value.LateUpdate(); //} foreach (KeyValuePair <string, VertexPool> pair in MatDic) { pair.Value.LateUpdate(); } } else { for (int i = 0; i < MatList.Count; i++) { VertexPool vp = MatList[i]; vp.LateUpdate(); } } }
void LateUpdate() { //make sure each mesh position is always zero. for (int i = 0; i < MeshList.Count; i++) { GameObject obj = MeshList[i]; if (obj != null) { obj.transform.position = Vector3.zero; obj.transform.rotation = Quaternion.identity; } } if (MergeSameMaterialMesh) { //ElementAt() STILL CAUSE GC ALLOC!! SO WE CAN'T AVOID GC ALLOC IN DICTIONARY? //for (int i = 0; i < MatDic.Count; i++) //{ // KeyValuePair<string,VertexPool> pair = MatDic.ElementAt(i); // pair.Value.LateUpdate(); //} foreach (KeyValuePair <string, VertexPool> pair in MatDic) { pair.Value.LateUpdate(); } } else { for (int i = 0; i < MatList.Count; i++) { VertexPool vp = MatList[i]; vp.LateUpdate(); } } if (ElapsedTime > LifeTime && LifeTime >= 0) { DoFinish(); } else if (LifeTime < 0 && EflList.Count > 0) { //Xffect LifeTime < 0, 且又是EmitByRate的话,会自动判断是否已经没有活动节点,没有则自动Deactive()。 float deltaTime = (float)(CurTime - LastTime); bool allEfLFinished = true; for (int i = 0; i < EflList.Count; i++) { EffectLayer el = EflList[i]; if (!el.EmitOver(deltaTime)) { allEfLFinished = false; } } if (allEfLFinished) { DoFinish(); } } }