How do I manage a large Editor Script Plugin?

Good day fellow programmers!
Over the last 4 months I have been working on a fairly large Unity Script Plugin. As of late it has been getting excitedly difficult to manage keep the code clear and simple.
My main Editor Window script has over 1,400 lines of code.
Somehow I need to break down the plugin into readable chunks. The problem is that many of the systems and variables constantly interact with each other. The plugin is a Node Graph similar to Mechanim and I need to split the Inspector(), DrawNode(), DrawConnections() and other functions into different scripts.
Does anyone have a suggestion on how I could approach this?
I would greatly appreciate the help! :slight_smile:

Why isn’t “Draw Node” a method of the node itself? Same with “Draw Connections”…

Thanks! They can totally be moved there. I’ve been starting at the code for to long lol.
However I would like to separate the code that will not be modified that often such as my Inputs(), DragSelect() and a dozen utility functions such as DeselectAllNodes(), Duplicate(), Copy(), AddNode(). They themselves make up 500 lines.

Sometimes all you need is good spacing and #region. May also help to move obvious blocks into their own method

The best long term solution might be to refactor, but as an interim hack you can split big classes up into multiple files by using the c# partial keyword.

There’s your problem, Unity Script Plugin. Should be c# plugin honestly. A good IDE goes miles in terms of script file navigation and readability.

I didn’t mean the Unity Script language just a script in Unity lol. It’s all C# :slight_smile:

Alright, then are you using MonoDevelop or Visual Studio?

Visual Studio. I started to dislike Mono after it crashed on me every 5 minutes. Why you ask?

Good, Visual Studio has a TON of features for code maneuvering, are you aware of them? I’m pretty sure in recent updates they’ve surpassed MonoDevelop by a lot. I’m referring to features such as Go To Declaration, Find References, method/region collapsing, to name a few.

I believe I use most of those however are there any that are hidden and often not used that I am not aware of?

It’s hard for me to comment on Visual Studio because I don’t have it. But I do know of one cool feature called Peek Definition.