- Home /
This question was
closed Jan 09, 2012 at 12:18 PM by
syclamoth for the following reason:
Duplicate Question
Question by
DFiable · Jan 09, 2012 at 11:58 AM ·
androidperformanceoptimizationfind
Is there a more efficient way to writ a "Find" script?
I'm working on Android Unity Pro. My game has hundreds of "Find" scripts and I trying to optimize performance. Is there a better way to avoid writing a "Find" script? Below is a typical "Find' script in my game. This script is on a different game object. Remember, this is just an example of hundreds of similar "Find" scripts.If someone could teach me how to write it more efficiently I'd appreciate it. thanx
function OnTriggerEnter( myTrigger : Collider){
if(myTrigger.gameObject.name == "tum1-2"){
var myTryagain : CameraControls = gameObject.Find("Main Camera").GetComponent(CameraControls);
myTryagain.enabled = false;
}
}
Comment
Follow this Question
Related Questions
Is there a more efficient way to write a "Find" script? 2 Answers
measuring performance on android 0 Answers
Which Unity functions are generally slow/bad for performance? 4 Answers
Optimization Question about Singleton 2 Answers
Android Best performance 1 Answer