This is a script i've made for Unity3D, which provides an algorithm for managing a list of targets, by creating an item carousel for it. With the item carousel you gain the ability to control items (for example a 4 target camera system, where with a press of the arrows, you swap to the next/previous camera).
This can be used in multiple projects such as: A character selection screen, an item selection/viewer, auto camera swap etc.
- Upload the script to your project.
- Create a group with objects and a parent.
- Inherit the script to your class.
- Inititalise the group of objects by calling the function Init_SelecTargets(GameObject targetParent).
- Adjust your code, so whenever you want to move to the next item in the carousel, by calling the NextTarget() or PrevTarget() functions.

