Hello,
I am searching a method to put a function name into a variable with C#
For exemple with Melscript (into Maya) we can deal with a string variable keeping the name of the function.
If you want to call it you can use the “eval” function and it gives something like the following :
string $myfunc = "SAMA_Script_A()" ;
eval ($myfunc);
Well with C#, a colleague spoke to me about the the “FuncDelegate” thing.
Did some research but I am into a complete misunderstanding.
Now what I am making is the following :
I work with the GUI.Window function :
static function Window (id : int, clientRect : Rect, func : WindowFunction, text : String) : Rect
In my code I am using it into another function to build many other windows using the same “template” :
void Create_Window_A (float pos_X, int buttonCount, string Window_Content)
{
GUI.Window(0, new Rect(pos_X, Button_Pos_Y, Button_Scale_X * buttonCount, Button_Scale_Y), Window_Content, "test", GUI.skin.FindStyle("Window"));
}
Window_Content is the function building the content of my window.
Well, for now that is a string variable because I am years of light to understand how to deal with.
Then does someone know how to travel a function with variable into function entry to use it into GUI.Window with C#??
Thank you much for your help…