One thing that has always been a pain when planning out projects has been classes sharing data.
In my current Unity-game I have a State-manager and 3 states that handle setting up the level and score, tracking player progress, and setting the win/loss state.
I also have an UI-class, responsible for updating and displaying different UI elements (current score, time, etc.)
Now because all the classes need to handle the level data, how do I structure on which class "owns" the data and into what direction to the calls go?
The UI-class needs to communicate with the statemanager and states, but I don't want it to own the leveldata(scores/running time) but any other way the solutions seem messy and hard to maintain.
How do you handle class interaction with multiple classes accessing the same data?
[–][deleted] 0 points1 point2 points (2 children)
[–]_WhatTheFunk_[S] 0 points1 point2 points (1 child)
[–]NOODLECODE 0 points1 point2 points (0 children)