- Home /
EditorWindow reference to other scripts functions
Hi, I'm doing an EditorWindow tool and it's getting really good.
But.. it's also getting really big ;) Homemade Menu Tabs and all..
So, I'm refactoring - instead of one large : EditorWindow -script with EVERYTHING I'd like it to be a 'mainTool' -script and in that just run other script's functions.
So for instance one script is handling menuTabs in the EditorWindow set up by 'mainTool', and another is populating functions & GUILayout.Button("OK") - type of things in 'main' etc so 'main' will be kept lean&clean..
All documentation & discussions on the overall subject of calling a function from one class in another class appears to be focused around the typical scenario of GameObjects with Components and MonoBehaviour, and that's all very standard.
But I cannot find the clean way to do this with EditorWindow, not even sure how I should reference the other scripts when there's no components to get and in general things are a little strange.
If you have any clue (or ideas or experience) on how to best set this up, I'd be much appreciated :)
Thanks!
you can make static classes with only static methods to tidy your code a bit. and if you need to store data use ScriptableObject