I have a selection mechanic that will select objects underneath a drag gesture. I'm trying to deselect the objects when retracing the gesture backwards... the code bellow works for deselecting objects when going over them again, but i want to limit it to the order the objects are in the array. Essentially so objects can only be deselected in the reverse order they were selected in, including the last. if that makes sense.
asked Jan 30 '12 at 10:36 PM
Editing: I just noticed that you are using RemoveAt, which means the array is a JS array.
Just use Pop():
This would remove the last entry from the array and assign it to LastItem.
Shift() would remove from the beginning.