I mean processing wise.
Say, I do something like:
GemScript gemScript = new GameObject("Gem").AddComponent<GemScript>();
SpriteRenderer spriteRenderer = gemScript.gameObject.AddComponent<SpriteRenderer>();
etc etc add a box collider to it.
vs
Instantiate ;
GemScript gemScript = gameObjectInstantiation.FindComponent();
Which would be faster?
I am having a tough time deciding to go full code to easily reference vs use prefabs and then FindComponent.
Scripting offers me some ease in implementing and flexibility, whereas prefab allows me ease to change stuff. At least, that’s what my limited knowledge tells me. My friend has been telling me that using script to generate objects is highly inefficient, which I argue is not bad really.
I’d like to know what you guys think about it?
Edit: I don’t know if I put it correctly, in essence it’s a question about how well UnityEngine handles instantiation, scenes etc vs manually spawning with script.