/// <summary> /// Update the specified list. /// </summary> void UpdateList(List <UpdateEntry> list, float delta) { for (int i = list.Count; i > 0;) { UpdateEntry ent = list[--i]; // If it's a monobehaviour we need to do additional checks if (ent.isMonoBehaviour) { // If the monobehaviour is null, remove this entry if (ent.mb == null) { list.RemoveAt(i); continue; } } // Call the function try { ent.func(delta); } catch (Exception e) { Debug.LogException(e); } } }
/// <summary> /// Update the specified list. /// </summary> void UpdateList(List <UpdateEntry> list, float delta) { for (int i = list.Count; i > 0;) { UpdateEntry ent = list[--i]; // If it's a monobehaviour we need to do additional checks if (ent.isMonoBehaviour) { // If the monobehaviour is null, remove this entry if (ent.mb == null) { list.RemoveAt(i); continue; } // If the monobehaviour or its game object are disabled, move on to the next entry if (!ent.mb.enabled || !NGUITools.GetActive(ent.mb.gameObject)) { continue; } } // Call the function ent.func(delta); } }
private void UpdateList(List <UpdateEntry> list, float delta) { int count = list.Count; while (count > 0) { UpdateEntry entry = list[--count]; if (entry.isMonoBehaviour) { if (entry.mb == null) { list.RemoveAt(count); continue; } if (!entry.mb.enabled || !NGUITools.GetActive(entry.mb.gameObject)) { continue; } } entry.func(delta); } }
private void UpdateList(List <UpdateEntry> list, float delta) { int num = list.Count; while (num > 0) { UpdateEntry updateEntry = list[--num]; if (updateEntry.isMonoBehaviour) { if (updateEntry.mb == null) { list.RemoveAt(num); continue; } if (!updateEntry.mb.enabled || !NGUITools.GetActive(updateEntry.mb.gameObject)) { continue; } } updateEntry.func(delta); } }