What a key difference between soft and hard references?
Is there a perfomance difference if i am would parse array of soft and hard references?
So, deleting the object with many hard references may cost more perfomance cause dependence calculations?
If i am calling object by hard ref to get some variable, does it cost more calculations cause it load all cross-referenced objects too?
Think of soft reference as a String with path to the object which is referenced. and having a soft reference will mean that even if the level in which the object is placed in is unloaded the game will still remember which object it was.
Hard reference makes it so when you will call the reference it will load the object being referenced.
i am not sure what you are talking about :/. you will just get errors if you delete the object referenced. and it should return Accessed none error.
Ok, how about second question?
im not 100% sure but i think using soft reference might be better. since it actually load up the object and just keeps a reference of all the stuff in it.
Someone correct me if i am wrong…
As far as I understand this the difference between soft and hard reference is for the hard reference object being lost in case it is unloaded while with a soft referenced object can be checked if it is loaded. If not then you can load it and access it afterwards.
I don’t know how soft-reference behave for destroyed objects.
No, and no.
Basically a reference is kinda a bookmark for an object in your ram (let’s put aside the details about c pointer and reference in coding context). Accessing this bookmark takes you just to the object, if it does not exist anymore you get a NullReferenceException.