I have a ScriptableObject of class Item
, which is presented in a crafting editor, let’s call it "Casing"
.
To craft the final item, one needs to insert other Item
type objects, let’s call them "Components"
, inside and then press “Build” button.
To calculate the final properties of the object before crafting, I want to create a dummy of the "Casing"
object, fill it with the currently present "Components"
, and build an item with the current proerties.
So, I copy the "Casing"
:
Item dummy_casing;
Item original_casing = GetParentCasing();
dummy_casing = Instantiate(original_casing);
And insert "Components"
inside. However, the objects are added to both original and dummy versions.
The "Casing"
object has ItemSlot
objects, which hold the "Components"
. Is it possible, that when creating a copy of the "Casing"
, the ItemSlot
objects inside the copy are the same as in the original? If so, how to prevent this?