How to handle Systems / Controllers in UE4?
we are developing a kind of CAD application using UE4 and I'm constantly facing this annoying problem: let's say I have my main controller (eg. entry point of my custom application) where I bind inputs to handlers, instantiate uobjects, spawn default actors.. many of these uobjects are systems / subcontrollers / services that will get called everywhere in my codebase (objects factories, network services, etc.).
I was thinking about creating some kind of resolver much like in a dependency injection scenario where you configure your container by registering types. The actual implementation would ideally require a
How would you manage instances of these kind of objects in such application? Right now I have an
Have a nice day, Michele M.
I think it's fine as lot of engine code do what are you doing, there is centralized main UEnigne class which contains references to lot of other engine subsystems
You can also make some static pointer to it with TWeakObjectPtr, or just make singleton access point in the module class same lot of engine modules have with Get() function:
Also think if you really need to use UObjects for you system if you doing C++ only, some API are sitting in module class like HTTP i showed above. Module classes can be also accessed via module manager
answered Apr 06 '17 at 11:42 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here