LevelUp

Author: Divinux

Description
Provides the basic formula for leveling up characters based on experience points.

Usage
Just drop the script onto your character or a manager GameObject. Now, how you implement it depends on your game. Just call GainExp(int) from whatever object/action you want to reward your player for. Dying enemy, found item, destroyed building, you get the idea.

Once the player has accumulated enough experience, LvlUp is called automatically. Add whatever cool stuff should happen on level up here. You know, trumpet sounds, sparkly particles, increase player strength,...

Oh, and don't forget to add a juicy UI experience bar! Just in case, the progress bar should have a width of x *(vCurrExp/vExpLeft), with x being the maximum width of the progress bar.

Credit
I can't find the original forum even with google unfortunately. But I saved myself the crucial bit of the thread in a text file:

So thanks for that, random internet guy.

History

 * 15 July 2016 - Release