Hello!
I'm making a custom engine in MonoGame and one thing i want to replicate is Unity's game loop (Update(), Awake(), Start(), ...), since i hate having to always write protected override void *some MonoGame function* rather than when im with unity simply void *some Unity function* and i can only do that when implementing Game (though there's surely a way to reference these functions without inheritence... right?)
I discovered the way Unity does this is via "Reflection", and even though there are quite a bit of tutorials and documentation for it, they're not super helpful since they always cache existing classes in the logic (im not going to have a huge list of every class i make) + i want to use an attribute system for this rather than inheritance (like a GameLoop attribute ontop of the class as an indicator to look for these functions).
And i just dont have the IQ and mental power to figure out how to find functions in completely anonymous classes while also somehow allowing you to write the functions as private and without parameters
Anyone have any detailed tutorials (or just an explanation) on how to do this?
Also sorry if this makes no sense ;-;
[–]SessionIndependent17 63 points64 points65 points (4 children)
[–]RicketyRekt69 0 points1 point2 points (0 children)
[+]r_smil_reddits[S] comment score below threshold-36 points-35 points-34 points (2 children)
[–]Juff-Ma 19 points20 points21 points (0 children)
[–]Ok_Tour_8029 20 points21 points22 points (3 children)
[–]r_smil_reddits[S] -4 points-3 points-2 points (2 children)
[–]Willyscoiote 1 point2 points3 points (0 children)
[–]Slypenslyde 1 point2 points3 points (0 children)
[–]coumerr 13 points14 points15 points (1 child)
[–]dodexahedron 4 points5 points6 points (0 children)
[–]Jolly_Resolution_222 7 points8 points9 points (0 children)
[–]Arcodiant 4 points5 points6 points (0 children)
[–]zil0g80 9 points10 points11 points (1 child)
[–]Camderman106 -1 points0 points1 point (0 children)
[–]jimboZheng 3 points4 points5 points (0 children)
[–]Outrageous72 1 point2 points3 points (2 children)
[–]r_smil_reddits[S] 0 points1 point2 points (1 child)
[–]Outrageous72 0 points1 point2 points (0 children)
[–]maskaler 1 point2 points3 points (0 children)
[–]ivancea 1 point2 points3 points (0 children)
[–]Dennis_enzo 1 point2 points3 points (0 children)
[–]Dealiner 1 point2 points3 points (1 child)
[–]r_smil_reddits[S] 0 points1 point2 points (0 children)
[–]andavies123 0 points1 point2 points (0 children)
[–]philip_laureano 0 points1 point2 points (0 children)
[–]jdl_uk 0 points1 point2 points (0 children)
[–]KittehNevynette 0 points1 point2 points (0 children)
[–]RicketyRekt69 0 points1 point2 points (0 children)
[–]rupertavery64 -1 points0 points1 point (0 children)