【发布时间】:2022-12-02 01:04:13
【问题描述】:
How do I store method inside a method in a List<>?
I know its a bit confusing but idk how to explain it in more details. That's how I understand my problem.
So I wanna store methods inside a List<> and one of the method consists another method inside it. Since the List is executed as first in first out, when it comes to the method with another method inside, I want it to execute the child until it finishes before it continues to another element in the parent List.
For scenario, the method with another method inside is A Loop. I want it to iterate until certain condition is met then it stops. Then, continues to another method store in parents List.
As for now, I can store method inside List. It just idk how to execute the method inside method.
【问题讨论】:
-
hi and elcome. Please post the code of "the method consists another method inside it"
-
I don't understand your question or problem, and by the sounds of it you're probably approaching your actual problem, incorrectly. But if you still want to store methods in a list you could use List of Func<T,TResult>.
标签: c# unityscript