Y
Y
yraiv2022-02-19 15:25:47
Unity
yraiv, 2022-02-19 15:25:47

How can a method be called if it differs from the previous one by 1 digit?

I am making levels and it became interesting to me how to call a method if it differs from the previous one by only 1 digit?
My rounds are in order and I need to call the next one. type
Round1()
Round2()
etc.
How can I change the number in this? I know that it is possible to convert data into strings, is there a way to deal with this problem too?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
freeExec, 2022-02-19
@yraiv

Yes, you have some bullshit. Must be
void Round(int roundIndex)

G
GavriKos, 2022-02-19
@GavriKos

So directly - only through reflection, and this is labor-intensive.
You can get by with architectural solutions - put methods / classes into a container, and iterate over them.
Code will not give)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question