I did a search on this topic, but the answers gave a method for uninterrupted increase. They recommended HOTween.
What I have is a mana bar (magical energy). Whenever the character uses a magical ability, some mana is subtracted from the bar. Over time, the mana should automatically refill, let's say at a rate of 1 point per second. I have maximum mana set to 100, just for sake of ease.
How can I set up the automatic refilling of mana in my ManaManager? Currently, I created an FSM which checks if the mana is at max, and if not then it goes into a state called "Increase Energy". But I'm at a loss as to how I should increase mana here. I want the flexibility to change the rate of increase (when the player trains, they can increase the rate of mana recharge). Also, I don't think I should be tweening mana, because the player can discharge some mana even if it's not full. If I do a tween, the mana will continue to rise until the tween is completed, regardless of whether the player is using mana during that time.
Any suggestions? Thanks in advance.