If a game object is referencing an asset, when does this asset start using memory? As soon as the level loads, or only “when I need it” (eg when I actually access said reference in a script) ?
For example, in my game the characters have “alternate” skins (like in Street Fighter where Ryu is white but if you play Ryu vs Ryu, Ryu 2 will be red or something).
So I have 2 textures, both referenced by a “skin switch” script that applies the correct texture to the renderer’s material… so will Unity load both textures when the character is instantiated? To put it another way, will both textures use memory, or only the one used by the renderer?
In case they do, how do I go around it? I know I could use Resources.Load but I hate it because then I have to use asset names (strings… yuk!), and I lose the benefit of the inspector.
Now, what about prefabs? Eg if a prefab references an asset, and a GO references this prefab, I assume the asset will not use memory as long as it’s not instantiated…?
I apologize if I’m not being very clear, I may not even be asking the right questions… I really need to get a clear picture of all this.
This has actually been bothering me for a while but I’m never found clear-cut answers in the documentation, so if anyone has good resources on the subject, I’m all ears!