Tag Info

Hot answers tagged

1

http://en.wikipedia.org/wiki/Flyweight_pattern is the pattern name if I'm reading your question correctly.


1

It would be better to add a bool variable into your Script and then toggle it on/off. var object1Script = object1.GetComponent<MyScript>(); var object2Script = object2.GetComponent<MyScript>(); object1Script.enabled = toggle; object2Script.enabled = !toggle;


1

I am not quite sure what you are not understanding here, but I attempt to answer your question anyway. I am not quite getting what that does or what purpose it serves. In cases where you do not fill in the fields in the inspector (which requires them to be public), you need to find the instances of the needed components in code. The ...


1

Your TryToCreateNewMiner function can call it again. If your RandomPercent calculator keeps returning true, the callstack gets deeper and deeper. TryToCreateNewMiner->Miner->StartDigging->TryToCreateNewMiner


1

1) You don't need to calculate the visible objects in a single frame, you may use a bit bigger viewport, and calcultate only 500 objects per frame, if you have 20000 objects and your framerate is 50fps, in 40 frames you will have the right list, and it will take 0.8 secs 2) if your objects are not very complex or are static, sometimes is faster to put them ...



Only top voted, non community-wiki answers of a minimum length are eligible