Tags and GameObject.Find are very slow performance wise. Plus you have to tell Find the type of object a lot of times which is even stupider ; ) The general rule of thumb is to set them up at the beginning of the game or start of a level, etc. because using them in real-time will be a frame rate hit. Theoretically then Prefabs really aren’t effecient even though they are the cornerstone of Unity development.
It just seams like Unity should have a registry of named Objects in the scene at all times. You should be able to code:
Scene.star_destroyer.transform.position = Vector3(0,0,0);
or
Scene[star_destroyer]transform.position = Vector3(0,0,0);
or even better just:
star_destroyer.transform.position = Vector3(0,0,0);
without expressly telling what object you are looking for and what kind of object it is. It should just know afterall it *f___ing made it : ) haha, this is obviously a “hot button” issue for me. I can’t see how a game engine so advance and elegant as Unity could be missing such a simple protocol.
If the GameObject is not there and the engine throws an exception that fine because thats just bad programming to be trying to call something that doesn’t exist or is the wrong type for what you intend to do with it.
Maybe I am overlooking some core performance issue but I would love to know why it doesn’t do these simple things.
The other thing that severely annoys me is that any code in the Assets folder has to all be compiled without an error before you can move on. Say I worked on a script and moved it to an “Unused” folder and it is NOT linked to any active GO, why the hell does it need to compile!? Maybe I have changed vars since then but I am keeping the code handy because I just might need in the next day or two.
On the same front why does it add textures to a build that are NOT on an active GOs or GOs that are linked anywhere in the scene? I make temp texture for something to see the UV alignment and then replace it with the final texture. The next build I run I see it being added. Why?
Flash is just much smarter in some circumstances like this. If you intend to use something not in the scene you set it to be linked. Otherwise it doesn’t compile with the run time build, that would just be a waste of space.
Believe me I am a huge fan of Unity but they need to be more conscious of the fact that hundreds of thousands of Flash developers would buy Unity if they made it feel more intuitive.
The fact that you cannot control when scripts Awake, Start, etc. fire is also a mystery to me. Why not just have a layer order like Flash/Director so that you know for a fact they run in sequence?
There are workarounds for all of these issues, but without them the software SHOULD be much cheaper if it takes every programmer days to get past these problems plus is litters the forums with stupid questions. I know I have asked more than my fair share : )
So again why can we not store an Array in PlayerPrefs - thats user friendly.
back to work haha
thx again Tri3