- Home /
Getting parameter values sent to a method c sharp script
I want to retrieve the values sent to a method outside the invocation of the method, using this example
public void myExample(int a, int b) {..}
I could call with :
myExample(10,20);
Outside of the method which contains the invocation for myExample, I want to find what values were sent to it.
Store the values somewhere as you pass them into the function, or store them in myExample. Alternatively, have a function call inside myExample that tells whatever you want to know what the parameters where.
Alternatively, have a function call inside myExample that tells whatever you want to know what the parameters where.
I considered that, for example a string containing all the parameter values passed to the function method.
Why a string? Depending on what you want to do with the parameters, why not just pass them through as they are?
It really depends what you're attempting to do with the parameters at the other end.
yes, I could do that as well, I can really convert them as required.
Your answer
Follow this Question
Related Questions
Get Value/String From GUIText 3 Answers
Error when trying to parse csv file 1 Answer
Trouble referencing variables inside of a script (C#) 1 Answer
Lerping issues (C #) 2 Answers
Trouble setting a variable to a game object using instantiate. 1 Answer