❔ I have a basic structuring issue
this is unity but it doesn't really matter for the sake of this
I have a character which can move around and look around, but sometimes the movement changes and the mouse movements might be menus
so I have a main class and an array of possible active classes for controlling movement, and another array for controling viewing, along with a variable for the current one of each. Sometimes the movement class has to get information from the viewing class, how should i structure this
i think that having a reference between the two will make it bad, I am not sure honestly, and I am not sure with the rest of the structure
3 Replies
when in doubt, add a level of indirection
not sure what kind of mess that would become, but u could do it with
Action handler;
fields and stuff it all in one partial class with multiple sources:
PlayerController.cs
PlayerController.Grounded.cs
PlayerController.Airborne.cs
and so on. so u sorta have a separation, not too much nesting and still access to the same statesWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.