
[ad_1]
I’m a former Unity consumer, and after an enormous pause in recreation dev determined to check out Monogame (I’m a software program engineer IRL so I’d determine that is one of the simplest ways to go).
In Unity I used to be utilizing scriptable objects to decouple my information from their mutators / customers, as defined right here.
For instance, I’d have a scriptable object that represented my participant’s well being, and my participant entity would simply have it as a public discipline and within the editor I might drag the scriptable object in.
My UI was additionally within the well being, so I might simply expose a public discipline on my well being bar and it will devour it.
Hence my information was decoupled from the as soon as utilizing it and no dependencies the place between completely different programs.
So I’d like to breed this in Monogame.
I used to be considering of utilizing one thing like a service supplier / locator sample the place I might register the well being for my participant for instance and every system needing it will retrieve it trough that.
This appears much less versatile although then the way in which Unity exhibits it, as I might have a number of ‘healths’ registered, and to get the correct one would imply I’d must discover a technique to retrieve the correct one (which is completely doable however extra advanced then simply dragging in the correct scriptable object in Unity).
Someone discovered a pleasant means of doing this earlier than I dive in?
[ad_2]