You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So far custom libraries are instantiated only with Activator.CreateInstance(libClass); and the library creator has no straightforward way to access the library instance.
Given the current implementation, it's a bit hard for library developers to inject objects to the library instance in runtime (considering in a Unity game the GameManager instance needs to be passed in). Possible ways include using a singleton (global) as the proxy, etc. Instead, the following solutions could be way better and worth being considered:
Enable lib creators to instantiate the lib with passed-in arguments. Or,
Enable lib creators to inject argument objects to a lib instance during runtime. Or,
Let lib creators define a Context class type and associate an instance of the Context type with the lib instance. Or,
Let lib creators define their own logic (as a callback closure) to instantiate the lib. Or,
...
The text was updated successfully, but these errors were encountered:
Hallo, is this still in the works? Right now I'd be very interested in being able to access a library instance (just so I can inject the object that my Engine is "attached" to).
Hallo, is this still in the works? Right now I'd be very interested in being able to access a library instance (just so I can inject the object that my Engine is "attached" to).
Ah, yes, it is still in the plan. My bandwidth has been occupied with other tasks. I will try to make time to complete this.
So far custom libraries are instantiated only with
Activator.CreateInstance(libClass);
and the library creator has no straightforward way to access the library instance.Given the current implementation, it's a bit hard for library developers to inject objects to the library instance in runtime (considering in a Unity game the GameManager instance needs to be passed in). Possible ways include using a singleton (global) as the proxy, etc. Instead, the following solutions could be way better and worth being considered:
The text was updated successfully, but these errors were encountered: