Question by
ayks · Jun 18, 2017 at 07:03 PM ·
ifoptimisation
if and optimisation
if (!go.activeself)go.SetActive(true);
vs
go.SetActive(true);
is it worth to check if the gameobject is not yet active before activate it ?
in the first code it has to check if its not already active but in the second if it's already active it will reactive it which will be useless.
Thanks
Comment
Your answer
Follow this Question
Related Questions
Lerp Not working 1 Answer
Wrong Trigger causes action to run,Multiple Triggers cause the same event 0 Answers
Procedurally generate a block of blocks vertically as the character moves upwards? 0 Answers
Unity Update is ignoring the GetKey part of my statement!? 2 Answers
Enemy waits 5 seconds after attack 0 Answers