Hi all,
I like to make my scripts organized and easy to read, but I’ve got too many variables lying around and the inspector has become clustered and disorganized; so I’m trying to find a way to tidy up my variables but no on line documentation has been able to help me.
I’m looking for a way to categorize my variables and put them under a collapsible menu. So I created different classes for different types of variables, like this:
[System.Serializable]
public class ShootVariables : System.Object {
//My variables go here
}
public ShootVariables shootVariables = new ShootVariables();
But every time I need to reference to variables inside that class, I have to first make reference to that class, which is not very efficient:
shootVariables.damage = 5f;
recoilVariables.kickAmount = .5f
Is there a way to just use the variables without referencing the class?
I feel like I might be doing something wrong; Or could there be a different ways to create the collapsible menu? Or just a different way to organize your variables?
Thanks