gustavopsantos / Reflex

Minimal dependency injection framework for Unity
MIT License
730 stars 51 forks source link

Inject in non-MB #58

Closed cckelly closed 4 months ago

cckelly commented 4 months ago

This is more a question about how this works as it wasn't clear to me. Is there a way to use the Inject attribute in a non-monobehaviour? For example:

    public class MyTestClass
    {
        [Inject] private readonly MyInjectableClass _myClass;
    }

MyTestClass will be instantiated repeatedly throughout my app's lifecycle.

gustavopsantos commented 4 months ago

Answered this already in discord: https://discord.com/channels/1098008290052546731/1100153692054880366/1255521210356334592