- Home /
Why is this line of code in the loop (Scripting API example script)?
My question regards the Unity Scripting API Dropdown.options example script, specifically this part of the code:
Why is the underlined line of code in the loop?
Doesn't it set m_Index to the same number each time (as m_Messages.Count does not change) it is run in the loop?
Why not place is out of the loop after or before it?
(I do understand that it's purpose is to get the last valid index of the List)
Answer by ShadyProductions · Dec 29, 2018 at 01:47 PM
Seems unnecessary yes, it could be outside of the foreach loop.
Your answer
Follow this Question
Related Questions
Wondering if dropdown options list do not close automatically once selecting an option? 1 Answer
how to keep dropdown's tempelate at the centre of the screen regarless of position of dropdown bar ? 1 Answer
Native Picker Wheel - iOS UI 0 Answers
Making a blocker like dropdown menu for another gameobject. 0 Answers
Dropdown not working with Oculus 3 Answers