public IEnumerator Cooking(TimerUI timer, float timerFullAmt) { var curTime = timerFullAmt; while (curTime > 0) { timer.UpdateProcessUI(curTime, timerFullAmt); ingredientInfo.GetComponent <Renderer>().material.SetFloat("_Blend", timer.timerFill.fillAmount); curTime -= Time.deltaTime; ingredientInfo.cooking.TimeHeated += Time.deltaTime; yield return(null); } //if the pancake is not alr burnt, start burning the pancake if (!ingredientInfo.isBurning) { StartBurning(); } timer.ToggleHelper(false); }