- Home /
[ERROR!] GUI.WindowFunction with multiple parameters
Hello everyone,
As you can see in the documentation, the GUI.WindowFunction function receives only one argument, which is the id of the window that it is going to be handled. My problem is that I want to pass more than only the ID of the window and have no clue of how can I do that.
Here’s an example:
private void OnGUI()
{
...
screenText.PhysicalInfo = GUILayout.Window(screenText.ID, screenText.PhysicalInfo, DoMyWindow, "");
...
}
private void DisplayScreenText(int windowID, ScreenText screenText) {
...
}
Of course, this does not work, since calling the DisplayScreenText (GUI.WindowFunction) like DisplayScreenText(id,screenText), makes the code not-compile. Does anyone knows how to do this?
Notice that this is the only solution I'm looking for. Therefore, I'll have to ask you to please do not consider other alternatives. I know that I can use Dictionaries or other workarounds, which are rather simple and easy, but I'm inclined into using this one.
Thanks for your help.
Regards,
Sebastián
You can't pass any more arguments to the Window
function. It's just not designed to do that!
If you won't accept a workaround solution, then there is no answer to the question, other then you can't
Your answer
Follow this Question
Related Questions
GUI.DragWindow causing Inventory Tooltip to stop showing 0 Answers
GUI.DragWindow() doesnt work - cant figure out why 1 Answer
How to go to a new gui.window by clicking a gui.button? 1 Answer
GUI.Window putting multiple instances with diferent sizes on diferent locations 1 Answer
GUIUtility.hotControl on windows 0 Answers