Ownership Inversion in Delegates

As you probably know, I’m currently busy rewriting the Cloning system in Duality. While you can read most of my experiences doing so in my last blog entry, there is a peculiar little problem case that revealed itself just recently. It should be solved by now, but I thought it might be interesting enough for its own followup entry. Let’s call it Ownership Inversion in Delegates.

Read more …

How to Clone an Object

Making an exact copy of an object isn’t an everyday use case for most programming APIs, but there are certain tasks where the ability to do so is vital. It’s not an easy task per se, and it requires a lot of thought when executed on a larger scale. When designing a modular framework like Duality, where every user can easily add custom classes into the realm of conveniently automated behavior, things get even worse. Fingers crossed, I might finally have found a solution.

Read more …

Clone Wars

Tightly connected to Prefabs is the ability to clone GameObjects. If a Prefab is just a boxed and isolated GameObject hierarchy, instantiating a GameObject from a Prefab means to create a deep copy of the internal GameObject and pass the cloned version as a return value. Cloning an object might also come in handy for actual ingame usage, but either way, the possibility to do that is absolutely necessary.

But how?

Read more …