// Update is called once per frame void Update() { if (Time.time > processTime) { processTime += processTimeInc; if (inSafeRoom) { ChangeEnergy(energyGainRate); } else { ChangeEnergy(energyLossRate); } if (!currentRoom.isHaunted) { currentRoom.ChangeHaunting(hauntRate); } } }