- Home /
Question by
luniac · Nov 09, 2014 at 10:27 PM ·
coroutineoptimizationupdatetimerinvokerepeating
convert timer from update() to coroutine or invokerepeating
Lets say i have this code in Update()
if(fireRateBoostTime > 0){
fireRateBoostTime -= Time.deltaTime;
}
else{
fireRateBoostTime = 0;
boostPE.Stop();
coolDownTime = initCoolDownTime;
}
The variable fireRateBoostTime can be increased externally at ANY moment.
How would i convert this to a more efficient coroutine or invoke repeating,
AND is it even worth it if i always have 100 or less objects with this code active at any moment?
Comment
Your answer
Follow this Question
Related Questions
Any costs I should know about associated with InvokeRepeating? 1 Answer
Issues with InvokeRepeating in Start/Update functions 1 Answer
Optimization: Central "update" system vs using Updates 1 Answer
Do once when condition is met? 1 Answer
Reading input outside of Update or some other ticking system 2 Answers