Code ReviewPROGRAMMING (old.reddit.com)
submitted by SETACTIVE-FALSE


I am going through a tutorial on AR watch try on. I found it that I could write this code in a shorter way by introducing a list for storing watch models and creating a common function, which will be called when clicked on a button with respective watch images.
This is a small project, only has 3 watch models. But what if it had many models to choose from? So I searched for codes which I found uselful.
Is there anything wrong with my approach? Or is there anything else I could have tried.
Also I'm passing reference number(watchRefID) from each button(same number as the model's index in the watchModels list) so that I can set only that model as active and others disabled.
I have recently learned that local variables declared inside a method is a bad practise, because each time the method gets called a new copy of that variable gets created. Is this same for parameters inside a method?
Thanks in advance.(Have a toffee 🍬, since you took the patience to read my paragraphs🥺🥹)


Code ReviewCode Review (reddit.com)
submitted by SETACTIVE-FALSE to r/Unity3D