private void LateUpdate() { if (ShouldDestroy) { foreach (DropItemController dropItemController in InstancesList) { Destroy(dropItemController); } InstancesList.Clear(); ShouldDestroy = false; } }
/// <summary> /// Removes all elements from the list. /// </summary> public void Clear() { InstancesList.Clear(); OnInstancesListChanged(null, ListChangedType.Reset); }