game engine - Dynamically reloading classes in C# (looping through all instances) -


I am creating a game engine in C #, and my goal is to dynamically edit component squares and Being able to load is written in C #, what is known to me through a few different instances, it is actually possible to load an assembly (DLL) in an applet, then unload it and edit it Reload the compiled version. Through my own testing I have found that it works very well, only the sole problem is left, destroys all run-time references for a specific example of that object so that it is reloaded Can be done and changed.

Actually, I would like to be able to get a list of all references to a specific object. I know that it can be completely impossible in C #, because it relies on a language that stores a list of all objects referenced to a specific object. It does not matter that the implementation is incredibly slow, as long as it works properly.

I have pasted some pseudo code that I want to do:

I know in a way that I can do that I have my own "weak reference" type which I originally I use it everywhere, and never makes direct reference to any object, it seems like parts of the headache, but if AppDomain throws at least one exception, then any correct reference of the object Still exist Is. In fact, it puts management in my hands, rather than automatic and enforceable.

If you know a good way to do this, or do you think I'm doing something wrong, and thank you!

If you have not checked it already, you're really one. This will save you a lot of time instead of searching the wheel again.

Comments