How can I put a bunch of functions into an array and call them by index?
Right now I am using a Switch statement to select the function. But I want to be able to call it by index. Can be an array, list etc.
And what about performance? Lets say I have 100 functions (obv I wont but lets say);
Is it more performant using conditionals or by index to call the function?
Even if this is micro-optimization I would still like to understand what the code does for each behind the scenes.
Thanks.
Your answer
Follow this Question
Related Questions
How to use a function from another script 1 Answer
How to enable a Box when a Button is pressed 0 Answers
Error with unity shooting script: Monster Death Script Doesent Work 0 Answers
How to find and call a function on a scene object from UnityEvent that has a prefab referenced. 1 Answer
Transform array, index was outside the bounds of the array 0 Answers