Closed boraty14 closed 5 months ago
@boraty14 Hello o/
Like so:
@boraty14 Please let me know if that worked, or if you have any other questions ;)
Okay that was my bad, got a similar result once I disabled the debugger, so thanks!
And since you asked, how injection works for dynamically created monobehaviors? If it is on the scene from start it works but not if I create it at runtime. Tried to find some examples for it but could not find it in docs, Reflex looks really neat overall but I believe some more examples would be awesome, and thanks for your work!
@boraty14 If objects (pure c# objects or unity objects) are created during runtime, theres no way reflex can detect this creation to auto inject the object, this needs to be done manually.
AttributeInjector.Inject
.GameObjectInjector
depending on your needs
See https://github.com/gustavopsantos/Reflex?tab=readme-ov-file#-manual-injection for referenceThanks for the fast reply! I also saw that, part and once again I went through the manual. What confuses me is, altough I get the general idea with scoping, how do I get ahold of the container, especially the project and scene container. Even for manual scoping, I need a reference to parent container but where do I get that? Thanks!
Okay It is through extensions, found that one :D so thanks anyway @gustavopsantos for your replies! It was my fault for not seeing it, but even though I believe it would be highlt appreciated adding some intermediate examples to the examples. Keep up the good work!
I wanted to check out benchmarks locally, and reflex sample literally takes 4 seconds for each iteration and freezes unity. Is it an old sample? According to documentation Reflex should be both faster and less garbage allocated.