New answers tagged

4 votes
Accepted

How to clean up list entries when objects are destroyed in Unity?

The best way that I came up with is, according to the observer pattern, to notify all classes where the object was stored about its destruction and remove references to it from there. That's what I ...
Kevin's user avatar
  • 4,961
0 votes

What is the best way to implement a scene manager?

I am far away from being a pro, so excuse me if this is nonsense... But how about seeing a scene as a node and the manager as a kind of graph? The graph/manager could have a method to "search&...
El_Codepone's user avatar
0 votes

What is the best way to implement a scene manager?

One possible alternative, given that the only reason for the forward declaration is because you want IScene to be able to change the active scene from within its ...
Ryan1729's user avatar
  • 714
0 votes
Accepted

What is the best way to implement a scene manager?

Forward declaring is totally OK. The alternative would be exactly what you pointed out, cyclic dependencies (assuming that you have #include in your ...
Cherestes Radu's user avatar

Top 50 recent answers are included